This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]