From: Joel Brobecker <brobecker@adacore.com>
To: Eric Christopher <echristo@gmail.com>
Cc: David Blaikie <dblaikie@gmail.com>,
gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [patch] [gdb/testsuite] include a use of the definition of a type to cause clang to emit debug info
Date: Mon, 14 Apr 2014 18:16:00 -0000 [thread overview]
Message-ID: <20140414181623.GS4250@adacore.com> (raw)
In-Reply-To: <CALehDX48=_WQgGgBhogVzM=bQWTXd07NyKUizbdsyNFA9yX+bg@mail.gmail.com>
> > The gdb11479.exp is obvious and can be pushed. The change to gdb11479.c,
> > on the other hand, changes the test, and I don't think we want that,
> > because I disagree with the outcome of Clang's optimization here.
> > If Clang doesn't want to fix the problem, best to just xfail the test
> > with Clang, and write a new one that provides the type definition as
> > Clang wants it.
>
> Could you describe your objection here? In particular, as it relates
> to Dave's analysis of a similar gcc optimization. (Also a few people
> have been interested in implementing this same behavior in gcc).
The fact is, at the moment, that GCC generates the necessary debugging
information, without the need to create a typedef. If it stops working
thanks to a GCC "optimization", I would like to know about it (personally).
In this particular case, the type is used locally, albeit as a pointer,
and it would seem unfriendly to me that the user not be able to either
print the pointed object's size, or any of the enum's element, just
because it is only used via a pointer. I also seems strange to me
that an unused typedef is enough to trigger full debug info generation,
while a variable indirectly referencing a type is not.
That's why I suggested that we keep the current testcase as is,
with an xfail with clang, and create a new one if we want to, that
tests the behavior with the proposed work around.
That's only my opinion, however; it would be fine for the change
to go in if other maintainers disagree with me and approve the change.
--
Joel
next prev parent reply other threads:[~2014-04-14 18:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-13 6:43 David Blaikie
2014-04-13 7:52 ` David Blaikie
2014-04-23 23:04 ` Doug Evans
2014-04-14 13:10 ` Joel Brobecker
2014-04-14 15:53 ` Eric Christopher
2014-04-14 18:16 ` Joel Brobecker [this message]
2014-04-14 18:35 ` David Blaikie
2014-04-14 22:47 ` Joel Brobecker
2014-04-23 23:46 ` Pedro Alves
2014-04-24 0:20 ` Doug Evans
2014-04-24 0:29 ` Doug Evans
2014-04-24 12:36 ` Joel Brobecker
2014-04-25 5:32 ` David Blaikie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140414181623.GS4250@adacore.com \
--to=brobecker@adacore.com \
--cc=dblaikie@gmail.com \
--cc=echristo@gmail.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox