From: Nathan Froyd Date: Thu, 2 Aug 2007 14:40:36 +0000 (+0000) Subject: re PR middle-end/25445 (-fpic/-fPIC failure in gcc.dg/tree-ssa/wholeprogram-1.c) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d236f595e8fac9678388240b04c1ae25082f1d2a;p=gcc.git re PR middle-end/25445 (-fpic/-fPIC failure in gcc.dg/tree-ssa/wholeprogram-1.c) PR middle-end/25445 * varasm.c (default_binds_local_p_1): Consult flag_whole_program if we are compiling with -fPIC. From-SVN: r127162 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c79f2e71702..e712c821949 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2007-08-02 Nathan Froyd + + 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 Nigel Stephens diff --git a/gcc/varasm.c b/gcc/varasm.c index a265db8b5b3..b2b68cd96a9 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -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)