re PR middle-end/25445 (-fpic/-fPIC failure in gcc.dg/tree-ssa/wholeprogram-1.c)
authorNathan Froyd <froydnj@codesourcery.com>
Thu, 2 Aug 2007 14:40:36 +0000 (14:40 +0000)
committerNathan Froyd <froydnj@gcc.gnu.org>
Thu, 2 Aug 2007 14:40:36 +0000 (14:40 +0000)
PR middle-end/25445
* varasm.c (default_binds_local_p_1): Consult flag_whole_program
if we are compiling with -fPIC.

From-SVN: r127162

gcc/ChangeLog
gcc/varasm.c

index c79f2e717022a7e4643c1d37a129f6598e95d8cf..e712c821949e94afeeffef9db07e4b5bb322f928 100644 (file)
@@ -1,3 +1,9 @@
+2007-08-02  Nathan Froyd  <froydnj@codesourcery.com>
+
+       PR middle-end/25445
+       * varasm.c (default_binds_local_p_1): Consult flag_whole_program
+       if we are compiling with -fPIC.
+
 2007-08-02  Sandra Loosemore  <sandra@codesourcery.com>
            Nigel Stephens  <nigel@mips.com>
 
index a265db8b5b351d60ad3e11ea2d7a6a4c9619c4d4..b2b68cd96a9ea647efd9547669e7734271ef3a40 100644 (file)
@@ -6198,9 +6198,10 @@ default_binds_local_p_1 (tree exp, int shlib)
   else if (DECL_WEAK (exp))
     local_p = false;
   /* If PIC, then assume that any global name can be overridden by
-     symbols resolved from other modules.  */
+     symbols resolved from other modules, unless we are compiling with
+     -fwhole-program, which assumes that names are local.  */
   else if (shlib)
-    local_p = false;
+    local_p = flag_whole_program;
   /* Uninitialized COMMON variable may be unified with symbols
      resolved from other modules.  */
   else if (DECL_COMMON (exp)