This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Fix PR 30666 [4.3 Regression]


On 3/29/07, Doug Gregor <doug.gregor@gmail.com> wrote:
[The "empty message" bug returns. Argh!]

On 3/3/07, Richard Guenther <richard.guenther@gmail.com> wrote:
> On 3/3/07, Doug Gregor <doug.gregor@gmail.com> wrote:
> > This little patch fixes PR tree-optimization/20336, a 4.3 regression
> > where the canonical types system was failing to keep the built-in
> > complex types canonical. The problem shows up as a warning now, but
> > would be a crash with --disable-checking.
> >
> > Tested i686-pc-linux-gnu; no regressions.
> >
> > Okay for mainline?
>
> Is there a reason why simply calling build_complex_type is not enough?
> It looks like that will invoke layout_type and set TYPE_NAME (which
> is IMHO the right thing to do).

build_complex_type was placing IDENTIFIER_NODEs into TYPE_NAME, rather
than TYPE_DECLs as it should have. The attached patch fixes this
problem, and uses build_complex_type directly to build the predefined
complex types. Much better!

Tested i686-pc-linux-gnu; no regressions.

This is ok. For reference:


  The TYPE_NAME field contains info on the name used in the program
    for this type (for GDB symbol table output).  It is either a
    TYPE_DECL node, for types that are typedefs, or an IDENTIFIER_NODE
    in the case of structs, unions or enums that are known with a tag,
    or zero for types that have no special name.

(we seem to have other places that do not follow this rule very strictly)

Thanks,
Richard.

:REVIEWMAIL:

  Cheers,
  Doug

:ADDPATCH c:

2007-03-29 Douglas Gregor <doug.gregor@gmail.com>

        PR tree-optimization/30666
        * tree.c (build_complex_type): When creating type names for DWARF2
        debug info, create TYPE_DECLs for TYPE_NAME instead of
        IDENTIFIER_NODEs.
        (build_common_tree_nodes_2): Use build_complex_type when building
        predefined complex types, to preserve canonical types.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]