OSDN Git Service

* collect2.c (main): Add -fno-whole-program.
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Oct 2009 09:11:28 +0000 (09:11 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Oct 2009 09:11:28 +0000 (09:11 +0000)
* gcc.c (set_collect_gcc_options): Do not remove whole program here.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152521 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/collect2.c
gcc/gcc.c

index 3a8ac54..31b4ad7 100644 (file)
@@ -1,5 +1,10 @@
 2009-10-07  Jan Hubicka  <jh@suse.cz>
 
+       * collect2.c (main): Add -fno-whole-program.
+       * gcc.c (set_collect_gcc_options): Do not remove whole program here.
+
+2009-10-07  Jan Hubicka  <jh@suse.cz>
+
        * lto-symtab.c (lto_cgraph_replace_node): Assert that inline clones has
        no address taken.
        * cgraph.c (cgraph_mark_needed_node): Assert that inline clones are
index 20caa45..01ef431 100644 (file)
@@ -1271,8 +1271,8 @@ main (int argc, char **argv)
   obstack_free (&temporary_obstack, temporary_firstobj);
 
   /* -fno-profile-arcs -fno-test-coverage -fno-branch-probabilities
-     -fno-exceptions -w */
-  num_c_args += 5;
+     -fno-exceptions -w -fno-whole-program */
+  num_c_args += 6;
 
   c_argv = XCNEWVEC (char *, num_c_args);
   c_ptr = CONST_CAST2 (const char **, char **, c_argv);
@@ -1440,6 +1440,7 @@ main (int argc, char **argv)
   *c_ptr++ = "-fno-branch-probabilities";
   *c_ptr++ = "-fno-exceptions";
   *c_ptr++ = "-w";
+  *c_ptr++ = "-fno-whole-program";
 
   /* !!! When GCC calls collect2,
      it does not know whether it is calling collect2 or ld.
index 033c99f..d94462d 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -4636,11 +4636,6 @@ set_collect_gcc_options (void)
       if ((switches[i].live_cond & SWITCH_IGNORE) != 0)
        continue;
 
-      /* Don't use -fwhole-program when compiling the init and fini routines,
-        since we'd wrongly assume that the routines aren't needed.  */
-      if (strcmp (switches[i].part1, "fwhole-program") == 0)
-       continue;
-
       obstack_grow (&collect_obstack, "'-", 2);
       q = switches[i].part1;
       while ((p = strchr (q, '\'')))