------- Comment #10 from amacleod at redhat dot com  2006-05-30 22:05 -------
Created an attachment (id=11540)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11540&action=view)
proposed patch

yeah, not terribly suprising the bug came back. The original patch I applied
fixed a long standing issue in tree-dfa which happened to be causing the
original abort in 26757. Fixing the issue re-masked the root cause of the
problem for that testcase, and added some minimal consistency.

This testcase shows the root problem indeed still exist.  You can make the
problem "dissappear" again by referencing the global version of the variable
"verbose" first, before you mention the local extern version which gets a
different address.

What happens is that the ssa mechanism for dealing with referenced vars only
expects to see a single DECL_UID per pointer.  The first one it encounters is
entered into the hash table, and used to clear out the variable annotation on
the way out of ssa.  If the GLOBAL version of the variable is encountered
first, it gets entered into the table, and the annotation cleared on the way
out of ssa. This means its ready for use in the next function.

If the local version of the variable is encountered first, the global variable
never gets it annotation cleared since the local variable is the one in the
hash table. Things then go wonky in the next function to use it.

so, how to fix this for good. If it isnt going to change in the front end, we
have to maintain a list of duplicate pointers for DECL_UIDS... it could be done
without too much hassle, but its a real hack. I've attached a patch to do just
that. Try it out. Its going through bootstrapped test cycles now.


-- 


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

Reply via email to