This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto] Compute assembler names on builtins
- From: Diego Novillo <dnovillo at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 16 Mar 2009 09:16:32 -0400
- Subject: [lto] Compute assembler names on builtins
The recent assert added in lto1 for assembler names triggered
while testing libgomp. We were failing to set assembler names on
builtin functions. Fixed with this patch:
I also added -fPIC on a test that was failing on x86_64.
* tree.c (need_assembler_name_p): Always set assembler
name on builtins.
testsuite/ChangeLog.lto:
* g++.dg/lto/20090313_0.C: Add -fPIC.
Index: tree.c
===================================================================
--- tree.c (revision 144863)
+++ tree.c (working copy)
@@ -3945,11 +3945,12 @@ need_assembler_name_p (tree decl)
&& !DECL_EXTERNAL (decl))
return false;
- /* For FUNCTION_DECLs, we only are interested in addressable and used
- functions. */
+ /* For FUNCTION_DECLs, we only are interested in builtins,
+ addressable and used functions. */
if (TREE_CODE (decl) == FUNCTION_DECL
&& !TREE_USED (decl)
- && !TREE_ADDRESSABLE (decl))
+ && !TREE_ADDRESSABLE (decl)
+ && !DECL_BUILT_IN (decl))
return false;
return true;
Index: testsuite/g++.dg/lto/20090313_0.C
===================================================================
--- testsuite/g++.dg/lto/20090313_0.C (revision 144863)
+++ testsuite/g++.dg/lto/20090313_0.C (working copy)
@@ -1,5 +1,5 @@
// { dg-do "link" }
-// { dg-options "{-fwhopr}" }
+// { dg-options "{-fwhopr -fPIC}" }
// { dg-extra-ld-options "-fwhopr -shared" }
int X;