public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug debug/8354] Incorrect DWARF-2/3 emitted for const + array + typedef [not found] <20021025083608.8354.jcownie@etnus.com> @ 2003-06-07 22:16 ` pinskia@physics.uc.edu 2003-08-05 5:21 ` neroden at gcc dot gnu dot org ` (7 subsequent siblings) 8 siblings, 0 replies; 14+ messages in thread From: pinskia@physics.uc.edu @ 2003-06-07 22:16 UTC (permalink / raw) To: gcc-bugs PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8354 pinskia@physics.uc.edu changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Incorrect DWARF emitted for |Incorrect DWARF-2/3 emitted |const + array + typedef |for const + array + typedef ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug debug/8354] Incorrect DWARF-2/3 emitted for const + array + typedef [not found] <20021025083608.8354.jcownie@etnus.com> 2003-06-07 22:16 ` [Bug debug/8354] Incorrect DWARF-2/3 emitted for const + array + typedef pinskia@physics.uc.edu @ 2003-08-05 5:21 ` neroden at gcc dot gnu dot org 2003-11-26 17:34 ` pinskia at gcc dot gnu dot org ` (6 subsequent siblings) 8 siblings, 0 replies; 14+ messages in thread From: neroden at gcc dot gnu dot org @ 2003-08-05 5:21 UTC (permalink / raw) To: gcc-bugs PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8354 neroden at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |3.4 ------- Additional Comments From neroden at gcc dot gnu dot org 2003-08-05 05:21 ------- Targeting to 3.4 to get on the radar... Could someone who understands 'const' in C and/or DWARF better than me confirm that this behavior is, in fact, a bug? I can confirm that the behavior is the same in mainline (will be 3.4). ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug debug/8354] Incorrect DWARF-2/3 emitted for const + array + typedef [not found] <20021025083608.8354.jcownie@etnus.com> 2003-06-07 22:16 ` [Bug debug/8354] Incorrect DWARF-2/3 emitted for const + array + typedef pinskia@physics.uc.edu 2003-08-05 5:21 ` neroden at gcc dot gnu dot org @ 2003-11-26 17:34 ` pinskia at gcc dot gnu dot org 2004-01-01 23:26 ` [Bug debug/8354] Incorrect DWARF-2/3 emitted for const + array pinskia at gcc dot gnu dot org ` (5 subsequent siblings) 8 siblings, 0 replies; 14+ messages in thread From: pinskia at gcc dot gnu dot org @ 2003-11-26 17:34 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From pinskia at gcc dot gnu dot org 2003-11-26 17:34 ------- Confirmed. -- What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed| |1 Keywords| |wrong-code Last reconfirmed|0000-00-00 00:00:00 |2003-11-26 17:34:03 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8354 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug debug/8354] Incorrect DWARF-2/3 emitted for const + array [not found] <20021025083608.8354.jcownie@etnus.com> ` (2 preceding siblings ...) 2003-11-26 17:34 ` pinskia at gcc dot gnu dot org @ 2004-01-01 23:26 ` pinskia at gcc dot gnu dot org 2004-01-01 23:28 ` pinskia at gcc dot gnu dot org ` (4 subsequent siblings) 8 siblings, 0 replies; 14+ messages in thread From: pinskia at gcc dot gnu dot org @ 2004-01-01 23:26 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-01-01 23:26 ------- really confirmed, ICC 6.0 does not produce the extra DW_TAG_const_type and also this is not a regression. -- What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2003-11-26 17:34:03 |2004-01-01 23:26:26 date| | Summary|Incorrect DWARF-2/3 emitted |Incorrect DWARF-2/3 emitted |for const + array + typedef |for const + array Target Milestone|3.4.0 |--- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8354 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug debug/8354] Incorrect DWARF-2/3 emitted for const + array [not found] <20021025083608.8354.jcownie@etnus.com> ` (3 preceding siblings ...) 2004-01-01 23:26 ` [Bug debug/8354] Incorrect DWARF-2/3 emitted for const + array pinskia at gcc dot gnu dot org @ 2004-01-01 23:28 ` pinskia at gcc dot gnu dot org 2004-02-03 22:11 ` dpatel at apple dot com ` (3 subsequent siblings) 8 siblings, 0 replies; 14+ messages in thread From: pinskia at gcc dot gnu dot org @ 2004-01-01 23:28 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-01-01 23:27 ------- One more thing, a type def is not needed: int const ii[20][20]; will produce the extra DW_TAG_const_type. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8354 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug debug/8354] Incorrect DWARF-2/3 emitted for const + array [not found] <20021025083608.8354.jcownie@etnus.com> ` (4 preceding siblings ...) 2004-01-01 23:28 ` pinskia at gcc dot gnu dot org @ 2004-02-03 22:11 ` dpatel at apple dot com 2004-02-21 3:06 ` wilson at gcc dot gnu dot org ` (2 subsequent siblings) 8 siblings, 0 replies; 14+ messages in thread From: dpatel at apple dot com @ 2004-02-03 22:11 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From dpatel at apple dot com 2004-02-03 22:11 ------- Patch : http://gcc.gnu.org/ml/gcc-patches/2004-02/msg00030.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8354 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug debug/8354] Incorrect DWARF-2/3 emitted for const + array [not found] <20021025083608.8354.jcownie@etnus.com> ` (5 preceding siblings ...) 2004-02-03 22:11 ` dpatel at apple dot com @ 2004-02-21 3:06 ` wilson at gcc dot gnu dot org 2004-02-25 11:29 ` jcownie at etnus dot com 2005-01-28 23:54 ` wilson at gcc dot gnu dot org 8 siblings, 0 replies; 14+ messages in thread From: wilson at gcc dot gnu dot org @ 2004-02-21 3:06 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From wilson at gcc dot gnu dot org 2004-02-21 03:05 ------- See http://gcc.gnu.org/ml/gcc-patches/2004-02/msg01911.html for patch review. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8354 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug debug/8354] Incorrect DWARF-2/3 emitted for const + array [not found] <20021025083608.8354.jcownie@etnus.com> ` (6 preceding siblings ...) 2004-02-21 3:06 ` wilson at gcc dot gnu dot org @ 2004-02-25 11:29 ` jcownie at etnus dot com 2005-01-28 23:54 ` wilson at gcc dot gnu dot org 8 siblings, 0 replies; 14+ messages in thread From: jcownie at etnus dot com @ 2004-02-25 11:29 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From jcownie at etnus dot com 2004-02-25 11:29 ------- http://gcc.gnu.org/ml/gcc-patches/2004-02/msg01911.html seems to be the wrong reference (it's about loop peeling). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8354 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug debug/8354] Incorrect DWARF-2/3 emitted for const + array [not found] <20021025083608.8354.jcownie@etnus.com> ` (7 preceding siblings ...) 2004-02-25 11:29 ` jcownie at etnus dot com @ 2005-01-28 23:54 ` wilson at gcc dot gnu dot org 8 siblings, 0 replies; 14+ messages in thread From: wilson at gcc dot gnu dot org @ 2005-01-28 23:54 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From wilson at gcc dot gnu dot org 2005-01-28 23:54 ------- Here is the corrected link http://gcc.gnu.org/ml/gcc-patches/2004-02/msg01995.html or follow the link to the patch and click on followups. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8354 ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <bug-8354-1506@http.gcc.gnu.org/bugzilla/>]
* [Bug debug/8354] Incorrect DWARF-2/3 emitted for const + array [not found] <bug-8354-1506@http.gcc.gnu.org/bugzilla/> @ 2006-11-28 0:58 ` gary at intrepid dot com 2006-12-30 6:34 ` gary at intrepid dot com ` (2 subsequent siblings) 3 siblings, 0 replies; 14+ messages in thread From: gary at intrepid dot com @ 2006-11-28 0:58 UTC (permalink / raw) To: gcc-bugs ------- Comment #10 from gary at intrepid dot com 2006-11-28 00:58 ------- Created an attachment (id=12702) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12702&action=view) PR/8354 patch discussion thread As reported in Bug #20588, the referenced links to the gcc-patch mailing list archives are broken. The referenced mail messages are included in this attachment. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8354 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug debug/8354] Incorrect DWARF-2/3 emitted for const + array [not found] <bug-8354-1506@http.gcc.gnu.org/bugzilla/> 2006-11-28 0:58 ` gary at intrepid dot com @ 2006-12-30 6:34 ` gary at intrepid dot com 2007-01-01 22:47 ` gary at intrepid dot com 2007-01-09 17:40 ` gary at intrepid dot com 3 siblings, 0 replies; 14+ messages in thread From: gary at intrepid dot com @ 2006-12-30 6:34 UTC (permalink / raw) To: gcc-bugs ------- Comment #11 from gary at intrepid dot com 2006-12-30 06:34 ------- I looked into fixing GCC's DWARF 2 generation for types that are qualified (for example, "const" and "volatile", and in the case of UPC, "shared", "strict", and "relaxed") in order to ensure that GDB has an accurate understanding of when a particular object's type is qualified: http://sourceware.org/ml/gdb/2006-11/msg00185.html http://sourceware.org/ml/gdb/2006-12/msg00133.html http://sourceware.org/ml/gdb/2006-12/msg00177.html In the latter e-mail reply, copied below, I sketched out three possible ways to fix the DWARF 2 information that GCC presently generates for qualified types. It would be great if someone familiar with the GCC front-end reviews my analysis, and either corrects it, or improves upon the suggested approaches. Additionally, I'm a bit unsure on what the "correct" DWARF 2 information should look like in all cases. For example should the members/fields of a struct/union that is C-V qualified also be individually qualified? One commercial compiler that I tried did not do this. Alternatively, would all the possible DWARF 2 type qualifier representation issues best be handled within GDB? This would move the problem from GCC back to GDB, and at the same time improve upon inter-operability. --- copy of http://sourceware.org/ml/gdb/2006-12/msg00177.html --- Jim Blandy wrote: > > "Gary Funck" <gary@intrepid.com> writes: > > The main difficulty is that GCC doesn't create new qualified > > types for declarations. Rather, it sets TREE_READONLY() > > and TREE_THIS_VOLATILE() in the DECL node for declarations > > such as: > > > > volatile int A[10]; > > Ugh. That's a shame. Can't dwarf2out.c fix things up as it builds > the tree of struct die_structs from the GCC 'tree' type tree? In theory, it should be possible. I worked on this a bit, but I think to do it right, this fix will require contribution/direction from someone more conversant in the GCC front-end, and more knowledgeable about how the other language front-ends use both the DWARF 2 generation routines, and the extent to which they depend upon the type information remaining in its current form. Three approaches to fixing the front end to create appropriate DWARF 2 information come to mind: (1) Change the GCC front-end, so that when it creates type information and associates the type information with a declaration that it fully qualifies the type definition, in a way that preserves language semantics, yet also ensures that the correct DWARF 2 information is generated for qualified types. (2) Create the fully qualified type definition in dwarf2out.c (probably in routines that handle DECL items such as gen_formal_parameter_die(), gen_variable_die() and gen_field_die()). There are two likely sub-approaches: (i) keep this fully qualified type definition on the side, parallel to the existing type definition structure, or (ii) smash the new fully qualified type into the DECL node's TREE_TYPE() value. Keeping a parallel definition may be difficult because various parts of dwarfout.c may need to refer back to the DECL node's type value, and all places that do this will have to be found and fixed. Cross-type references and typedef's create another set of problems. Rewriting the declaration's type value is the most straightforward, but runs the risk of violating various assumptions made by the language front-ends, and will require a rather elaborate "deep copy" mechanism to make sure the fix up is done correctly. (3) Run a final pass over the internal DWARF tree built within dwarfout.c to fix up the type qualifiers, basically propagating the const_ and volatile_ qualifiers down to lower levels as required. This is probably doable, but will slow down DWARF generation for all compilations, even if most compilations seldom use "const" and "volatile" (and other qualifiers, such as UPC's "shared", "strict", and "relaxed"). In this case, it seems that dwarf2out.c is fixing representation issues that more correctly should be solved in the front-end. Given the tradeoffs, choice (1) above, where the type description is fully qualified at the time the type is bound to the DECL item, seems more correct, but may impact the correct operation of the various language front-ends and therefore will require more care and more study. Choice (2) is perhaps a bad compromise, and choice (3) is likely workable, but kludgy. -- gary at intrepid dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gary at intrepid dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8354 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug debug/8354] Incorrect DWARF-2/3 emitted for const + array [not found] <bug-8354-1506@http.gcc.gnu.org/bugzilla/> 2006-11-28 0:58 ` gary at intrepid dot com 2006-12-30 6:34 ` gary at intrepid dot com @ 2007-01-01 22:47 ` gary at intrepid dot com 2007-01-09 17:40 ` gary at intrepid dot com 3 siblings, 0 replies; 14+ messages in thread From: gary at intrepid dot com @ 2007-01-01 22:47 UTC (permalink / raw) To: gcc-bugs ------- Comment #12 from gary at intrepid dot com 2007-01-01 22:47 ------- Jim Wilson posted thi follow up to the GDB list: http://sourceware.org/ml/gdb/2007-01/msg00007.html From: Jim Wilson <wilson at specifix dot com> Date: Mon, 01 Jan 2007 14:15:47 -0800 Subject: RE: how to support C type qualifiers applied to arrays? On Thu, 2006-12-14 at 12:22 -0800, Gary Funck wrote: > The main difficulty is that GCC doesn't create new qualified > types for declarations. Rather, it sets TREE_READONLY() > and TREE_THIS_VOLATILE() in the DECL node for declarations > such as: > volatile int A[10]; If you look at the types created by the C front end, they are OK. c_build_qualified_type knows how to handle an array correctly. The problem arises in the DWARF2 output code. gen_type_die calls type_main_variant for all types other than vector types, which strips off the const and volatile type modifiers. Then it clumsily tries to put them back later in gen_variable_die, except that for array types, it puts them back in the wrong place. This seems to answer the question I asked long ago. Why are we trying to put back qualifiers from the decl? Because gen_type_die stripped them off. This seems wrong. If we fix gen_type_die to stop calling type_main_variant, and if we fix gen_variable_die to stop adding back the type qualifiers, then I get the right result. So I think I was on the right track before, we just need another little change to gen_type_die in addition to what I already described. I haven't investigated this in detail yet. There may be other parts of the code that expect to see a type main variant here, so we might need other cascading fixes. This still seems fixable to me though. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8354 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug debug/8354] Incorrect DWARF-2/3 emitted for const + array [not found] <bug-8354-1506@http.gcc.gnu.org/bugzilla/> ` (2 preceding siblings ...) 2007-01-01 22:47 ` gary at intrepid dot com @ 2007-01-09 17:40 ` gary at intrepid dot com 3 siblings, 0 replies; 14+ messages in thread From: gary at intrepid dot com @ 2007-01-09 17:40 UTC (permalink / raw) To: gcc-bugs ------- Comment #13 from gary at intrepid dot com 2007-01-09 17:40 ------- http://sourceware.org/ml/gdb/2007-01/msg00147.html From: "Gary Funck" <gary at intrepid dot com> To: <gdb at sourceware dot org> Date: Tue, 9 Jan 2007 09:01:38 -0800 Subject: RE: how to support C type qualifiers applied to arrays? Jim Wilson wrote (in part): > This seems to answer the question I asked long ago. Why are we trying > to put back qualifiers from the decl? Because gen_type_die stripped > them off. This seems wrong. > It seems that the use of type_main_variant() dates back to the original port of the DWARF 1 generator to the DWARF 2 implementation. I didn't try understanding the DWARF 1 generator in detail, but it seemed that the use of the type's main variant helped limit the number of unique type dies that were generated. In any event, it doesn't appear that there is a compelling reason to continue to use the type_main_variant() for DWARF 2 generatiion, especially in light of the fact that in some cases the DWARF 2 information is incorrect in the current implmentation. There are of course the risks that you mentioned in your reply that there may now be implicit assumptions made by the various clients (C, C++, Fortran, Ada, for example) regarding dependencies upon the type_main_variant(), but we may have to deal with those issues as they arise. > If we fix gen_type_die to stop calling type_main_variant, and > if we fix > gen_variable_die to stop adding back the type qualifiers, > then I get the > right result. So I think I was on the right track before, we > just need > another little change to gen_type_die in addition to what I already > described. I'll give this a try, and follow up. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8354 ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <bug-8354-4@http.gcc.gnu.org/bugzilla/>]
* [Bug debug/8354] Incorrect DWARF-2/3 emitted for const + array [not found] <bug-8354-4@http.gcc.gnu.org/bugzilla/> @ 2024-01-23 12:31 ` rguenth at gcc dot gnu.org 0 siblings, 0 replies; 14+ messages in thread From: rguenth at gcc dot gnu.org @ 2024-01-23 12:31 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=8354 Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2005-12-28 06:14:12 |2024-1-23 --- Comment #14 from Richard Biener <rguenth at gcc dot gnu.org> --- Re-confirmed for both C and C++ ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2024-01-23 12:31 UTC | newest] Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20021025083608.8354.jcownie@etnus.com> 2003-06-07 22:16 ` [Bug debug/8354] Incorrect DWARF-2/3 emitted for const + array + typedef pinskia@physics.uc.edu 2003-08-05 5:21 ` neroden at gcc dot gnu dot org 2003-11-26 17:34 ` pinskia at gcc dot gnu dot org 2004-01-01 23:26 ` [Bug debug/8354] Incorrect DWARF-2/3 emitted for const + array pinskia at gcc dot gnu dot org 2004-01-01 23:28 ` pinskia at gcc dot gnu dot org 2004-02-03 22:11 ` dpatel at apple dot com 2004-02-21 3:06 ` wilson at gcc dot gnu dot org 2004-02-25 11:29 ` jcownie at etnus dot com 2005-01-28 23:54 ` wilson at gcc dot gnu dot org [not found] <bug-8354-1506@http.gcc.gnu.org/bugzilla/> 2006-11-28 0:58 ` gary at intrepid dot com 2006-12-30 6:34 ` gary at intrepid dot com 2007-01-01 22:47 ` gary at intrepid dot com 2007-01-09 17:40 ` gary at intrepid dot com [not found] <bug-8354-4@http.gcc.gnu.org/bugzilla/> 2024-01-23 12:31 ` rguenth at gcc dot gnu.org
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).