http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51950

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-01-25
         AssignedTo|unassigned at gcc dot       |jakub at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-01-25 
17:41:58 UTC ---
Created attachment 26465
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26465
gcc47-pr51950.patch

Untested fix.

This "regressed" with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162691
which just made a cloning bug no longer latent, because DW_AT_object_pointer
the patch added is a reference to one of its children.  The problem is that we
were using clone_tree to clone all the children (in this case of
DW_TAG_subroutine_type), but clone_tree didn't enter all the children
(DW_TAG_formal_parameter in particular) into the hash table.  So we ended up
with a clone DW_TAG_subroutine_type with a single cloned
DW_TAG_formal_parameter.  Next clone_decls_walk attempted to adjust the
references in the attributes (DW_AT_object_pointer), but nothing was in the
hash table, so it created another DW_TAG_formal_parameter clone, and when
adding also its ancestor tree the DW_TAG_subroutine_type has been found in the
hash table and so this second DW_TAG_formal_parameter has been added as another
child.

Reply via email to