[lto][patch] Clear DECL_CONTEXT of TREE_STATIC decls

Rafael Espindola espindola@google.com
Mon Jan 12 16:40:00 GMT 2009


This patch fixes some tests. In particular, some libstdc++ tests were
failing with

ld: ./cc5zfnJb.lto.ltrans.o: requires unsupported dynamic reloc;
recompile with -fPIC
ld: ./cc5zfnJb.lto.ltrans.o: in function
_Z6test01v:cc5zfnJb.lto.o(.text._Z6test01v+0x2): undefined reference
to '._83'

The logic of the patch is that, for codegen, a static variable in a
function is not different from a global static variable.
I found this while debugging another issue, so I actually don't know
exactly how these tests are fixed by the patch :-)

2009-01-12  Rafael Avila de Espindola  <espindola@google.com>

	* tree.c (reset_decl_lang_specific): Clear DECL_CONTEXT of TREE_STATIC
	VAR_DECLs.

Cheers,
-- 
Rafael Avila de Espindola

Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047
-------------- next part --------------
A non-text attachment was scrubbed...
Name: static.patch
Type: text/x-diff
Size: 417 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090112/6bcedae4/attachment.bin>


More information about the Gcc-patches mailing list