Am Fri 02 Dec 2011 01:38:46 PM CET schrieb Richard Guenther
<rguent...@suse.de>:
This fixes a recent regression on the testcase of PR47259 where
we bring local a global register variable during WPA time and
then mangle its register name spec during ltrans. Oops.
indeed... (I am not in general sure how LTO should deal to global
register vars: i.e. when function come from unit not declaring it, it
should not limit RA)
It doesn't make sense to bring "local" global register variables.
Fixed by making varpool_externally_visible_p return true
for all DECL_HARD_REGISTER decls.
This seems fine to me: after all global register is always visible
from the other units.
Honza, does this look like the correct fix? Or should we represent
global register vars differently in the varpool? Any idea what
caused this to regress?
No idea actually. Originally the strategy was to not make register
variables hit the varpool (since they are registers, not vars in
tranditional sense), but I believe that was changed long time ago
(because for ipa-reference and friends it variable is).
Honza
Sofar tested on the testcase only.
Thanks,
Richard.
2011-12-02 Richard Guenther <rguent...@suse.de>
PR lto/47259
* ipa.c (varpool_externally_visible_p): Register variables
are always externally visible.
Index: gcc/ipa.c
===================================================================
--- gcc/ipa.c (revision 181902)
+++ gcc/ipa.c (working copy)
@@ -662,6 +662,8 @@ varpool_externally_visible_p (struct var
if (varpool_used_from_object_file_p (vnode))
return true;
+ if (DECL_HARD_REGISTER (vnode->decl))
+ return true;
if (DECL_PRESERVE_P (vnode->decl))
return true;
if (lookup_attribute ("externally_visible",