------- Comment #10 from jason at gcc dot gnu dot org  2009-02-17 18:23 -------
Created an attachment (id=17313)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17313&action=view)
fix to get_symbol_constant_value (untested)

The bug is not in binds_local_p: binds_local_p returns true if the reference
can bind to a different shared object, which is not the case in this example. 
A reference to another translation unit in the same module is still a local
binding.

The problem is that get_symbol_constant_value assumes that TREE_STATIC means
that the variable is defined in the current translation unit, which is not
currently the case for C++.  Apparently this wasn't the case for Ada either,
but that has been corrected.

It seems to me that the obvious fix for 4.4 is to make
get_symbol_constant_value check !DECL_EXTERNAL.


-- 


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

Reply via email to