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]

Re: -fwhopr and -flto options reorg


Hi,
here is updated patch.  Removing flag_whopr is probably easier than keeping in around
given that it is usually used in conjunction with flag_lto.


Bootstrapped/regtested x86_64-linux, OK?

	* doc/invoke.texi (-fwhopr): Merge into -flto section.
	(-flto-partition): Document none.
	* gcc.c (LINK_COMMAND_SPEC): Remove -fwhopr.
	* lto-wrapper.c: Update comment.
	(run_gcc): Update LTO option parsing.
	* opts.c (finish_options): add support -flto-partition=none
	(common_handle_option): Remove fwhopr.
	* common.opt: Turn fwhopr into flto.
	* collect2.c (main): Update option handling.
	* cgraphunit.c (cgraph_decide_is_function_needed): Remove flag_whopr.
	* ipa-split.c (execute_split_functions): Remove flag_whopr.
	* ipa.c (function_and_variable_visibility): Remove flag_whopr.
	* ipa-prop.c (ipa_compute_jump_functions): Remove flag_whopr.
	* varpool.c (decide_is_variable_needed): Remove flag_whopr.
	
	* gcc.dg/20081223-1.c: Update LTO options.
	* gcc.dg/lto/20090206-1_0.c: Update LTO options.
	* gcc.dg/lto/20081118_0.c: Update LTO options.
	* gcc.dg/lto/ipareference_0.c: Update LTO options.
	* gcc.dg/lto/20100423-2_0.c: Update LTO options.
	* gcc.dg/lto/20081201-1_0.c: Update LTO options.
	* gcc.dg/lto/ipacp_0.c: Update LTO options.
	* gcc.dg/lto/20090116_0.c: Update LTO options.
	* gcc.dg/lto/20091015-1_0.c: Update LTO options.
	* gcc.dg/lto/20090126-2_0.c: Update LTO options.
	* gcc.dg/lto/20081202-2_0.c: Update LTO options.
	* gcc.dg/lto/20081204-1_0.c: Update LTO options.
	* gcc.dg/lto/const-uniq_0.c: Update LTO options.
	* gcc.dg/lto/20081224_0.c: Update LTO options.
	* gcc.dg/lto/20090219_0.c: Update LTO options.
	* gcc.dg/lto/ipareference2_0.c: Update LTO options.
	* gcc.dg/lto/20090206-2_0.c: Update LTO options.
	* gcc.dg/lto/20081115_0.c: Update LTO options.
	* gcc.dg/lto/20081201-2_0.c: Update LTO options.
	* gcc.dg/lto/20081120-2_0.c: Update LTO options.
	* gcc.dg/lto/materialize-1_0.c: Update LTO options.
	* gcc.dg/lto/20090126-1_0.c: Update LTO options.
	* gcc.dg/lto/20081202-1_0.c: Update LTO options.
	* gcc.dg/lto/noreturn-1_0.c: Update LTO options.
	* g++.dg/20090107-1.C: Update LTO options.
	* g++.dg/lto/pr45679-2_0.C: Update LTO options.
	* g++.dg/lto/20081123_0.C: Update LTO options.
	* g++.dg/lto/20090313_0.C: Update LTO options.
	* g++.dg/lto/20081125_0.C: Update LTO options.
	* g++.dg/lto/20081109-1_0.C: Update LTO options.
	* g++.dg/lto/20081219_0.C: Update LTO options.
	* g++.dg/lto/20100724-1_0.C: Update LTO options.
	* g++.dg/lto/20081204-1_0.C: Update LTO options.
	* g++.dg/lto/20090303_0.C: Update LTO options.
	* g++.dg/lto/20100723-1_0.C: Update LTO options.
	* g++.dg/lto/pr45679-1_0.C: Update LTO options.
	* g++.dg/lto/20090128_0.C: Update LTO options.
	* g++.dg/lto/20081204-2_0.C: Update LTO options.
	* g++.dg/lto/20090302_0.C: Update LTO options.
	* g++.dg/lto/20081119-1_0.C: Update LTO options.
	* g++.dg/lto/20081118_0.C: Update LTO options.
	* g++.dg/20090121-1.C: Update LTO options.
	* objc.dg/lto/lto.exp: Update LTO options.
	* lib/lto.exp: Update LTO options.
	* lib/gcc-dg.exp: Update LTO options.
	* lib/c-torture.exp: Update LTO options.
	* obj-c++.dg/lto/lto.exp: Update LTO options.
Index: doc/invoke.texi
===================================================================
*** doc/invoke.texi	(revision 166616)
--- doc/invoke.texi	(working copy)
*************** and those merged by attribute @code{exte
*** 7429,7442 ****
  and in effect are optimized more aggressively by interprocedural optimizers. If @command{gold} is used as the linker plugin, @code{externally_visible} attributes are automatically added to functions (not variable yet due to a current @command{gold} issue) that are accessed outside of LTO objects according to resolution file produced by @command{gold}.  For other linkers that cannot generate resolution file, explicit @code{externally_visible} attributes are still necessary.
  While this option is equivalent to proper use of the @code{static} keyword for
  programs consisting of a single file, in combination with option
! @option{-flto} or @option{-fwhopr} this flag can be used to
  compile many smaller scale programs since the functions and variables become
  local for the whole combined compilation unit, not for the single source file
  itself.
  
  This option implies @option{-fwhole-file} for Fortran programs.
  
! @item -flto
  @opindex flto
  This option runs the standard link-time optimizer.  When invoked
  with source code, it generates GIMPLE (one of GCC's internal
--- 7429,7442 ----
  and in effect are optimized more aggressively by interprocedural optimizers. If @command{gold} is used as the linker plugin, @code{externally_visible} attributes are automatically added to functions (not variable yet due to a current @command{gold} issue) that are accessed outside of LTO objects according to resolution file produced by @command{gold}.  For other linkers that cannot generate resolution file, explicit @code{externally_visible} attributes are still necessary.
  While this option is equivalent to proper use of the @code{static} keyword for
  programs consisting of a single file, in combination with option
! @option{-flto} this flag can be used to
  compile many smaller scale programs since the functions and variables become
  local for the whole combined compilation unit, not for the single source file
  itself.
  
  This option implies @option{-fwhole-file} for Fortran programs.
  
! @item -flto[=@var{n}]
  @opindex flto
  This option runs the standard link-time optimizer.  When invoked
  with source code, it generates GIMPLE (one of GCC's internal
*************** If you are not using @command{gold} and/
*** 7575,7586 ****
  will be extracted and linked as usual, but they will not participate
  in the LTO optimization process.
  
! Link time optimizations do not require the presence of the whole
! program to operate.  If the program does not require any symbols to
! be exported, it is possible to combine @option{-flto} and
! @option{-fwhopr} with @option{-fwhole-program} to allow the
! interprocedural optimizers to use more aggressive assumptions which
! may lead to improved optimization opportunities.
  
  Regarding portability: the current implementation of LTO makes no
  attempt at generating bytecode that can be ported between different
--- 7575,7587 ----
  will be extracted and linked as usual, but they will not participate
  in the LTO optimization process.
  
! Link time optimizations do not require the presence of the whole program to
! operate.  If the program does not require any symbols to be exported, it is
! possible to combine @option{-flto} and with @option{-fwhole-program} to allow
! the interprocedural optimizers to use more aggressive assumptions which may
! lead to improved optimization opportunities. 
! Use of @option{-fwhole-program} is not needed when linker plugin is
! active (see @option{-fuse-linker-plugin}).
  
  Regarding portability: the current implementation of LTO makes no
  attempt at generating bytecode that can be ported between different
*************** strict version check, so bytecode files 
*** 7589,7611 ****
  GCC will not work with an older/newer version of GCC.
  
  Link time optimization does not play well with generating debugging
! information.  Combining @option{-flto} or @option{-fwhopr} with
  @option{-g} is experimental.
  
- This option is disabled by default.
- 
- @item -fwhopr[=@var{n}]
- @opindex fwhopr
- This option is identical in functionality to @option{-flto} but it
- differs in how the final link stage is executed.  Instead of loading
- all the function bodies in memory, the callgraph is analyzed and
- optimization decisions are made (whole program analysis or WPA). Once
- optimization decisions are made, the callgraph is partitioned and the
- different sections are compiled separately (local transformations or
- LTRANS)@.  This process allows optimizations on very large programs
- that otherwise would not fit in memory.  This option enables
- @option{-fwpa} and @option{-fltrans} automatically.
- 
  If you specify the optional @var{n} the link stage is executed in
  parallel using @var{n} parallel jobs by utilizing an installed
  @command{make} program.  The environment variable @env{MAKE} may be
--- 7590,7598 ----
  GCC will not work with an older/newer version of GCC.
  
  Link time optimization does not play well with generating debugging
! information.  Combining @option{-flto} with
  @option{-g} is experimental.
  
  If you specify the optional @var{n} the link stage is executed in
  parallel using @var{n} parallel jobs by utilizing an installed
  @command{make} program.  The environment variable @env{MAKE} may be
*************** The parent Makefile will need a @samp{+}
*** 7618,7631 ****
  for this to work. This will likely only work if @env{MAKE} is 
  GNU make.
  
! Disabled by default.
  
  @item -flto-partition=@var{alg}
  @opindex flto-partition
  Specify partitioning algorithm used by @option{-fwhopr} mode.  The value is
  either @code{1to1} to specify partitioning corresponding to source files
  or @code{balanced} to specify partitioning into, if possible, equally sized
! chunks.  The default value is @code{balanced}.
  
  @item -fwpa
  @opindex fwpa
--- 7605,7620 ----
  for this to work. This will likely only work if @env{MAKE} is 
  GNU make.
  
! This option is disabled by default.
  
  @item -flto-partition=@var{alg}
  @opindex flto-partition
  Specify partitioning algorithm used by @option{-fwhopr} mode.  The value is
  either @code{1to1} to specify partitioning corresponding to source files
  or @code{balanced} to specify partitioning into, if possible, equally sized
! chunks.  Specifying @code{none} as an algorithm disables partitioning
! and streaming completely.
! The default value is @code{balanced}.
  
  @item -fwpa
  @opindex fwpa
Index: gcc.c
===================================================================
*** gcc.c	(revision 166616)
--- gcc.c	(working copy)
*************** proper position among the other output f
*** 645,651 ****
  /* We want %{T*} after %{L*} and %D so that it can be used to specify linker
     scripts which exist in user specified directories, or in standard
     directories.  */
! /* We pass any -flto and -fwhopr flags on to the linker, which is expected
     to understand them.  In practice, this means it had better be collect2.  */
  #ifndef LINK_COMMAND_SPEC
  #define LINK_COMMAND_SPEC "\
--- 645,651 ----
  /* We want %{T*} after %{L*} and %D so that it can be used to specify linker
     scripts which exist in user specified directories, or in standard
     directories.  */
! /* We pass any -flto flags on to the linker, which is expected
     to understand them.  In practice, this means it had better be collect2.  */
  #ifndef LINK_COMMAND_SPEC
  #define LINK_COMMAND_SPEC "\
*************** proper position among the other output f
*** 658,665 ****
      %{static|static-libgcc:-plugin-opt=-pass-through=%(lto_libgcc)}	\
      %{static:-plugin-opt=-pass-through=-lc}	\
      } \
!     %{flto:%<fcompare-debug*} %{fwhopr*:%<fcompare-debug*} \
!     %{flto} %{fwhopr*} %l " LINK_PIE_SPEC \
     "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\
      %{s} %{t} %{u*} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
      %{static:} %{L*} %(mfwrap) %(link_libgcc) %o\
--- 658,665 ----
      %{static|static-libgcc:-plugin-opt=-pass-through=%(lto_libgcc)}	\
      %{static:-plugin-opt=-pass-through=-lc}	\
      } \
!     %{flto*:%<fcompare-debug*} \
!     %{flto*} %l " LINK_PIE_SPEC \
     "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\
      %{s} %{t} %{u*} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
      %{static:} %{L*} %(mfwrap) %(link_libgcc) %o\
Index: cgraphunit.c
===================================================================
*** cgraphunit.c	(revision 166616)
--- cgraphunit.c	(working copy)
*************** cgraph_decide_is_function_needed (struct
*** 197,204 ****
  	    && !(DECL_CONTEXT (decl)
  		 && TREE_CODE (DECL_CONTEXT (decl)) == FUNCTION_DECL)))
         && !flag_whole_program
!        && !flag_lto
!        && !flag_whopr)
        && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
      return true;
  
--- 197,203 ----
  	    && !(DECL_CONTEXT (decl)
  		 && TREE_CODE (DECL_CONTEXT (decl)) == FUNCTION_DECL)))
         && !flag_whole_program
!        && !flag_lto)
        && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
      return true;
  
Index: testsuite/gcc.dg/20081223-1.c
===================================================================
*** testsuite/gcc.dg/20081223-1.c	(revision 166616)
--- testsuite/gcc.dg/20081223-1.c	(working copy)
***************
*** 1,5 ****
  /* { dg-do compile } */
! /* { dg-options "-fwhopr" { target lto } }  */
  
  typedef struct foo_ foo_t;
  foo_t bar;  /* { dg-error "storage size of 'bar' isn't known" }  */
--- 1,5 ----
  /* { dg-do compile } */
! /* { dg-options "-flto" { target lto } }  */
  
  typedef struct foo_ foo_t;
  foo_t bar;  /* { dg-error "storage size of 'bar' isn't known" }  */
Index: testsuite/gcc.dg/lto/20090206-1_0.c
===================================================================
*** testsuite/gcc.dg/lto/20090206-1_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/20090206-1_0.c	(working copy)
***************
*** 1,6 ****
  /* { dg-lto-do link } */
  /* { dg-skip-if "" { ! { i?86-*-linux* x86_64-*-linux* } } { "*" } { "" } } */
! /* { dg-lto-options {{-fPIC -r -nostdlib -fwhopr -msse2}} } */
  /* { dg-require-effective-target sse2 } */
  /* { dg-suppress-ld-options {-fPIC -msse2} } */
  
--- 1,6 ----
  /* { dg-lto-do link } */
  /* { dg-skip-if "" { ! { i?86-*-linux* x86_64-*-linux* } } { "*" } { "" } } */
! /* { dg-lto-options {{-fPIC -r -nostdlib -flto -flto-partition=1to1 -msse2}} } */
  /* { dg-require-effective-target sse2 } */
  /* { dg-suppress-ld-options {-fPIC -msse2} } */
  
Index: testsuite/gcc.dg/lto/20081118_0.c
===================================================================
*** testsuite/gcc.dg/lto/20081118_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/20081118_0.c	(working copy)
***************
*** 1,4 ****
! /* { dg-lto-options {{-O2 -DOPTIMIZE -fwhopr} {-O0 -fwhopr}} } */
  
  extern void abort (void);
  extern int f (void);
--- 1,4 ----
! /* { dg-lto-options {{-O2 -DOPTIMIZE -flto -flto-partition=1to1} {-O0 -flto -flto-partition=1to1}} } */
  
  extern void abort (void);
  extern int f (void);
Index: testsuite/gcc.dg/lto/ipareference_0.c
===================================================================
*** testsuite/gcc.dg/lto/ipareference_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/ipareference_0.c	(working copy)
***************
*** 1,4 ****
! /* { dg-lto-options {{ -O1 -fwhopr }} } */
  /* { dg-lto-do run } */
  
  /* Test that ipa-reference notice that get_val will not change since do_nothing does not
--- 1,4 ----
! /* { dg-lto-options {{ -O1 -flto -flto-partition=1to1 }} } */
  /* { dg-lto-do run } */
  
  /* Test that ipa-reference notice that get_val will not change since do_nothing does not
Index: testsuite/gcc.dg/lto/20100423-2_0.c
===================================================================
*** testsuite/gcc.dg/lto/20100423-2_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/20100423-2_0.c	(working copy)
***************
*** 1,5 ****
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-O2 -flto} {-O2 -fwhopr} {-O3 -flto} {-O3 -fwhopr}} } */
  
  #include <stdio.h>
  
--- 1,5 ----
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-O2 -flto -flto-partition=none} {-O2 -flto -flto-partition=1to1} {-O3 -flto -flto-partition=none} {-O3 -flto -flto-partition=1to1}} } */
  
  #include <stdio.h>
  
Index: testsuite/gcc.dg/lto/20081201-1_0.c
===================================================================
*** testsuite/gcc.dg/lto/20081201-1_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/20081201-1_0.c	(working copy)
***************
*** 1,4 ****
! /* { dg-lto-options {{-O2 -DOPTIMIZE -fwhopr} {-O0 -fwhopr}} } */
  
  extern void abort (void);
  
--- 1,4 ----
! /* { dg-lto-options {{-O2 -DOPTIMIZE -flto -flto-partition=1to1} {-O0 -flto -flto-partition=1to1}} } */
  
  extern void abort (void);
  
Index: testsuite/gcc.dg/lto/ipacp_0.c
===================================================================
*** testsuite/gcc.dg/lto/ipacp_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/ipacp_0.c	(working copy)
***************
*** 1,4 ****
! /* { dg-lto-options {{ -O1 -fwhopr -fipa-cp -fipa-cp-clone}} } */
  /* { dg-lto-do run } */
  
  /* Test that clonning happens and we unify declarations of a from both units.  */
--- 1,4 ----
! /* { dg-lto-options {{ -O1 -flto -flto-partition=1to1 -fipa-cp -fipa-cp-clone}} } */
  /* { dg-lto-do run } */
  
  /* Test that clonning happens and we unify declarations of a from both units.  */
Index: testsuite/gcc.dg/lto/20090116_0.c
===================================================================
*** testsuite/gcc.dg/lto/20090116_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/20090116_0.c	(working copy)
***************
*** 1,5 ****
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-O1 -fwhopr -fPIC}} } */
  /* { dg-extra-ld-options {-r -nostdlib -O0} } */
  
  int foo(void) {
--- 1,5 ----
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-O1 -flto -flto-partition=1to1 -fPIC}} } */
  /* { dg-extra-ld-options {-r -nostdlib -O0} } */
  
  int foo(void) {
Index: testsuite/gcc.dg/lto/20091015-1_0.c
===================================================================
*** testsuite/gcc.dg/lto/20091015-1_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/20091015-1_0.c	(working copy)
***************
*** 1,5 ****
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-fPIC -r -nostdlib -O2 -flto} {-fPIC -r -nostdlib -O2 -fwhopr}} } */
  
  #include "20091015-1_b.h"
  void diagnostic_initialize (FILE **stream) { *stream = stderr; }
--- 1,5 ----
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-fPIC -r -nostdlib -O2 -flto} {-fPIC -r -nostdlib -O2 -flto -flto-partition=1to1}} } */
  
  #include "20091015-1_b.h"
  void diagnostic_initialize (FILE **stream) { *stream = stderr; }
Index: testsuite/gcc.dg/lto/20090126-2_0.c
===================================================================
*** testsuite/gcc.dg/lto/20090126-2_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/20090126-2_0.c	(working copy)
***************
*** 1,6 ****
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-fPIC -O2 -fwhopr}} } */
! /* { dg-extra-ld-options {-fno-PIC -r -nostdlib -O2 -fwhopr} } */
  
  int main(int argc, char **argv) {
    return 0;
--- 1,6 ----
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-fPIC -O2 -flto -flto-partition=1to1}} } */
! /* { dg-extra-ld-options {-fno-PIC -r -nostdlib -O2 -flto -flto-partition=1to1} } */
  
  int main(int argc, char **argv) {
    return 0;
Index: testsuite/gcc.dg/lto/20081202-2_0.c
===================================================================
*** testsuite/gcc.dg/lto/20081202-2_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/20081202-2_0.c	(working copy)
***************
*** 1,4 ****
! /* { dg-lto-options {{-fwhopr -O3}} } */
  
  extern void exit (int);
  extern void *foo (void);
--- 1,4 ----
! /* { dg-lto-options {{-flto -flto-partition=1to1 -O3}} } */
  
  extern void exit (int);
  extern void *foo (void);
Index: testsuite/gcc.dg/lto/20081204-1_0.c
===================================================================
*** testsuite/gcc.dg/lto/20081204-1_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/20081204-1_0.c	(working copy)
***************
*** 1,5 ****
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-fwhopr -fPIC -r -nostdlib}} } */
  
  /* Tests for the absence during linking of:
     lto1: error: type of 'i' does not match original declaration  */
--- 1,5 ----
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-flto -flto-partition=1to1 -fPIC -r -nostdlib}} } */
  
  /* Tests for the absence during linking of:
     lto1: error: type of 'i' does not match original declaration  */
Index: testsuite/gcc.dg/lto/const-uniq_0.c
===================================================================
*** testsuite/gcc.dg/lto/const-uniq_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/const-uniq_0.c	(working copy)
***************
*** 1,7 ****
  /* The 3 constant initializers should be uniquized.  */
  
  /* { dg-lto-do run } */
! /* { dg-lto-options {{-Os -flto} {-Os -fwhopr} } } */
  
  int lookup1 (int i)
  {
--- 1,7 ----
  /* The 3 constant initializers should be uniquized.  */
  
  /* { dg-lto-do run } */
! /* { dg-lto-options {{-Os -flto -flto-partition=none} {-Os -flto -flto-partition=1to1} } } */
  
  int lookup1 (int i)
  {
Index: testsuite/gcc.dg/lto/20081224_0.c
===================================================================
*** testsuite/gcc.dg/lto/20081224_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/20081224_0.c	(working copy)
***************
*** 1,5 ****
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-fwhopr -r -nostdlib -fPIC}} } */
  #include "20081224_0.h"
  
  extern struct foo x;
--- 1,5 ----
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-flto -flto-partition=1to1 -r -nostdlib -fPIC}} } */
  #include "20081224_0.h"
  
  extern struct foo x;
Index: testsuite/gcc.dg/lto/20090219_0.c
===================================================================
*** testsuite/gcc.dg/lto/20090219_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/20090219_0.c	(working copy)
***************
*** 1,5 ****
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-O3 -fwhopr -fPIC -r -nostdlib}} } */
  
  struct Foo { int f1, f2, f3, f4, f5; };
  
--- 1,5 ----
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-O3 -flto -flto-partition=1to1 -fPIC -r -nostdlib}} } */
  
  struct Foo { int f1, f2, f3, f4, f5; };
  
Index: testsuite/gcc.dg/lto/ipareference2_0.c
===================================================================
*** testsuite/gcc.dg/lto/ipareference2_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/ipareference2_0.c	(working copy)
***************
*** 1,4 ****
! /* { dg-lto-options {{ -O1 -fwhopr -fwhole-program}} } */
  /* { dg-lto-do run } */
  
  /* Verify that ipa-reference marks A as constant and we fold references
--- 1,4 ----
! /* { dg-lto-options {{ -O1 -flto -flto-partition=1to1 -fwhole-program}} } */
  /* { dg-lto-do run } */
  
  /* Verify that ipa-reference marks A as constant and we fold references
Index: testsuite/gcc.dg/lto/20090206-2_0.c
===================================================================
*** testsuite/gcc.dg/lto/20090206-2_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/20090206-2_0.c	(working copy)
***************
*** 1,6 ****
  /* { dg-lto-do link } */
  /* { dg-skip-if "" { ! { i?86-*-linux* x86_64-*-linux* } } { "*" } { "" } } */
! /* { dg-lto-options {{-fwhopr -fPIC}} } */
  /* { dg-suppress-ld-options {-fPIC} } */
  
  void func(int n) {
--- 1,6 ----
  /* { dg-lto-do link } */
  /* { dg-skip-if "" { ! { i?86-*-linux* x86_64-*-linux* } } { "*" } { "" } } */
! /* { dg-lto-options {{-flto -flto-partition=1to1 -fPIC}} } */
  /* { dg-suppress-ld-options {-fPIC} } */
  
  void func(int n) {
Index: testsuite/gcc.dg/lto/20081115_0.c
===================================================================
*** testsuite/gcc.dg/lto/20081115_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/20081115_0.c	(working copy)
***************
*** 1,4 ****
! /* { dg-lto-options {{-O2 -DOPTIMIZE -fwhopr} {-O0 -fwhopr}} } */
  
  extern void abort (void);
  
--- 1,4 ----
! /* { dg-lto-options {{-O2 -DOPTIMIZE -flto -flto-partition=1to1} {-O0 -flto -flto-partition=1to1}} } */
  
  extern void abort (void);
  
Index: testsuite/gcc.dg/lto/20100423-1_0.c
===================================================================
*** testsuite/gcc.dg/lto/20100423-1_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/20100423-1_0.c	(working copy)
***************
*** 1,5 ****
  /* { dg-lto-do run } */
! /* { dg-lto-options {{-O2 -flto}} } */
  
  struct bar {int x;};
  extern struct bar foo(void);
--- 1,5 ----
  /* { dg-lto-do run } */
! /* { dg-lto-options {{-O2 -flto -flto-partition=none}} } */
  
  struct bar {int x;};
  extern struct bar foo(void);
Index: testsuite/gcc.dg/lto/20081201-2_0.c
===================================================================
*** testsuite/gcc.dg/lto/20081201-2_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/20081201-2_0.c	(working copy)
***************
*** 1,4 ****
! /* { dg-lto-options {{-O3 -fwhopr}} } */
  
  /* Test that cross-TU inlining works.  */
  
--- 1,4 ----
! /* { dg-lto-options {{-O3 -flto -flto-partition=1to1}} } */
  
  /* Test that cross-TU inlining works.  */
  
Index: testsuite/gcc.dg/lto/20081120-2_0.c
===================================================================
*** testsuite/gcc.dg/lto/20081120-2_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/20081120-2_0.c	(working copy)
***************
*** 1,3 ****
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-fwhopr -r -nostdlib}} } */
  void bar(void) {}
--- 1,3 ----
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-flto -flto-partition=1to1 -r -nostdlib}} } */
  void bar(void) {}
Index: testsuite/gcc.dg/lto/materialize-1_0.c
===================================================================
*** testsuite/gcc.dg/lto/materialize-1_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/materialize-1_0.c	(working copy)
***************
*** 1,4 ****
! /* { dg-lto-options {{ -O3 -fwhopr}} } */
  /* { dg-lto-do run } */
  extern void clone_me (int, int);
  int a=15;
--- 1,4 ----
! /* { dg-lto-options {{ -O3 -flto -flto-partition=1to1}} } */
  /* { dg-lto-do run } */
  extern void clone_me (int, int);
  int a=15;
Index: testsuite/gcc.dg/lto/20090126-1_0.c
===================================================================
*** testsuite/gcc.dg/lto/20090126-1_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/20090126-1_0.c	(working copy)
***************
*** 1,6 ****
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-O0 -fwhopr}} } */
! /* { dg-extra-ld-options {-r -nostdlib -O2 -fwhopr} } */
  
  int main(int argc, char **argv) {
    return 0;
--- 1,6 ----
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-O0 -flto -flto-partition=1to1}} } */
! /* { dg-extra-ld-options {-r -nostdlib -O2 -flto -flto-partition=1to1} } */
  
  int main(int argc, char **argv) {
    return 0;
Index: testsuite/gcc.dg/lto/20081202-1_0.c
===================================================================
*** testsuite/gcc.dg/lto/20081202-1_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/20081202-1_0.c	(working copy)
***************
*** 1,4 ****
! /* { dg-lto-options {{-fwhopr -O3}} } */
  
  extern void exit (int);
  extern void foo (void);
--- 1,4 ----
! /* { dg-lto-options {{-flto -flto-partition=1to1 -O3}} } */
  
  extern void exit (int);
  extern void foo (void);
Index: testsuite/gcc.dg/lto/noreturn-1_0.c
===================================================================
*** testsuite/gcc.dg/lto/noreturn-1_0.c	(revision 166616)
--- testsuite/gcc.dg/lto/noreturn-1_0.c	(working copy)
***************
*** 1,5 ****
  /* { dg-lto-do run } */
! /* { dg-lto-options {{-O2 -fwhopr} } } */
  
  void exit (int);
  __attribute__ ((noreturn))
--- 1,5 ----
  /* { dg-lto-do run } */
! /* { dg-lto-options {{-O2 -flto -flto-partition=1to1} } } */
  
  void exit (int);
  __attribute__ ((noreturn))
Index: testsuite/g++.dg/20090107-1.C
===================================================================
*** testsuite/g++.dg/20090107-1.C	(revision 166616)
--- testsuite/g++.dg/20090107-1.C	(working copy)
***************
*** 1,6 ****
  /* { dg-do compile } */
  /* { dg-require-effective-target lto } */
! /* { dg-options "-fwhopr -Wuninitialized -O1" }  */
  
  template <typename T> struct Q1 { typedef int x; };
  template <typename T> struct Q2 {
--- 1,6 ----
  /* { dg-do compile } */
  /* { dg-require-effective-target lto } */
! /* { dg-options "-flto -Wuninitialized -O1" }  */
  
  template <typename T> struct Q1 { typedef int x; };
  template <typename T> struct Q2 {
Index: testsuite/g++.dg/lto/pr45679-2_0.C
===================================================================
*** testsuite/g++.dg/lto/pr45679-2_0.C	(revision 166616)
--- testsuite/g++.dg/lto/pr45679-2_0.C	(working copy)
***************
*** 1,6 ****
  // { dg-lto-do link }
  // { dg-lto-options {{-O3 -Wno-multichar}} } 
! // { dg-extra-ld-options "-fwhopr -r -nostdlib" }
      extern "C" {
    typedef struct {
      union   {
--- 1,6 ----
  // { dg-lto-do link }
  // { dg-lto-options {{-O3 -Wno-multichar}} } 
! // { dg-extra-ld-options "-flto -flto-partition=1to1 -r -nostdlib" }
      extern "C" {
    typedef struct {
      union   {
Index: testsuite/g++.dg/lto/20081123_0.C
===================================================================
*** testsuite/g++.dg/lto/20081123_0.C	(revision 166616)
--- testsuite/g++.dg/lto/20081123_0.C	(working copy)
***************
*** 1,5 ****
  // { dg-lto-do link }
! // { dg-lto-options {{-fwhopr -r -nostdlib -fPIC}} }
  
  int
  f(void)
--- 1,5 ----
  // { dg-lto-do link }
! // { dg-lto-options {{-flto -flto-partition=1to1 -r -nostdlib -fPIC}} }
  
  int
  f(void)
Index: testsuite/g++.dg/lto/20090313_0.C
===================================================================
*** testsuite/g++.dg/lto/20090313_0.C	(revision 166616)
--- testsuite/g++.dg/lto/20090313_0.C	(working copy)
***************
*** 1,5 ****
  // { dg-lto-do link }
! // { dg-lto-options {{-fwhopr -fPIC}} }
! // { dg-extra-ld-options "-fwhopr -r -nostdlib" }
  
  int X;
--- 1,5 ----
  // { dg-lto-do link }
! // { dg-lto-options {{-flto -flto-partition=1to1 -fPIC}} }
! // { dg-extra-ld-options "-flto -flto-partition=1to1 -r -nostdlib" }
  
  int X;
Index: testsuite/g++.dg/lto/20081125_0.C
===================================================================
*** testsuite/g++.dg/lto/20081125_0.C	(revision 166616)
--- testsuite/g++.dg/lto/20081125_0.C	(working copy)
***************
*** 1,5 ****
  // { dg-lto-do link }
! // { dg-lto-options {{-fwhopr}} }
  #include "20081125.h"
  
  object::object (int x)
--- 1,5 ----
  // { dg-lto-do link }
! // { dg-lto-options {{-flto -flto-partition=1to1}} }
  #include "20081125.h"
  
  object::object (int x)
Index: testsuite/g++.dg/lto/20081109-1_0.C
===================================================================
*** testsuite/g++.dg/lto/20081109-1_0.C	(revision 166616)
--- testsuite/g++.dg/lto/20081109-1_0.C	(working copy)
***************
*** 1,5 ****
  // { dg-lto-do link }
! // { dg-lto-options {{-fPIC -fwhopr}} }
! // { dg-extra-ld-options "-fPIC -fwhopr -r -nostdlib -fno-exceptions" }
  void func(); class Foo { };
  void bar() { try { func(); } catch (Foo) { } };
--- 1,5 ----
  // { dg-lto-do link }
! // { dg-lto-options {{-fPIC -flto -flto-partition=1to1}} }
! // { dg-extra-ld-options "-fPIC -flto -flto-partition=1to1 -r -nostdlib -fno-exceptions" }
  void func(); class Foo { };
  void bar() { try { func(); } catch (Foo) { } };
Index: testsuite/g++.dg/lto/20081219_0.C
===================================================================
*** testsuite/g++.dg/lto/20081219_0.C	(revision 166616)
--- testsuite/g++.dg/lto/20081219_0.C	(working copy)
***************
*** 1,6 ****
  // { dg-lto-do link }
! // { dg-lto-options {{-fPIC -fwhopr -O2}} }
! // { dg-extra-ld-options "-O2 -fPIC -fwhopr -r -nostdlib" }
  
  typedef long int ptrdiff_t;
  extern "C"
--- 1,6 ----
  // { dg-lto-do link }
! // { dg-lto-options {{-fPIC -flto -flto-partition=1to1 -O2}} }
! // { dg-extra-ld-options "-O2 -fPIC -flto -flto-partition=1to1 -r -nostdlib" }
  
  typedef long int ptrdiff_t;
  extern "C"
Index: testsuite/g++.dg/lto/20100724-1_0.C
===================================================================
*** testsuite/g++.dg/lto/20100724-1_0.C	(revision 166616)
--- testsuite/g++.dg/lto/20100724-1_0.C	(working copy)
***************
*** 1,5 ****
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-ftoplevel-reorder -flto} {-ftoplevel-reorder -fwhopr}} } */
  /* { dg-extra-ld-options {-r -nostdlib} } */
  
  struct Foo { virtual ~Foo(); };
--- 1,5 ----
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-ftoplevel-reorder -flto -flto-partition=none} {-ftoplevel-reorder -flto -flto-partition=1to1}} } */
  /* { dg-extra-ld-options {-r -nostdlib} } */
  
  struct Foo { virtual ~Foo(); };
Index: testsuite/g++.dg/lto/20081204-1_0.C
===================================================================
*** testsuite/g++.dg/lto/20081204-1_0.C	(revision 166616)
--- testsuite/g++.dg/lto/20081204-1_0.C	(working copy)
***************
*** 1,5 ****
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-fwhopr -fPIC -r -nostdlib}} } */
  
  /* Tests for the absence during linking of:
     lto1: error: type of '_ZTVN10__cxxabiv120__si_class_type_infoE' does
--- 1,5 ----
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-flto -flto-partition=1to1 -fPIC -r -nostdlib}} } */
  
  /* Tests for the absence during linking of:
     lto1: error: type of '_ZTVN10__cxxabiv120__si_class_type_infoE' does
Index: testsuite/g++.dg/lto/20090303_0.C
===================================================================
*** testsuite/g++.dg/lto/20090303_0.C	(revision 166616)
--- testsuite/g++.dg/lto/20090303_0.C	(working copy)
***************
*** 1,5 ****
  /* { dg-lto-do run } */
! /* { dg-lto-options {{-fwhopr -fPIC}} } */
  /* { dg-suppress-ld-options {-fPIC} }  */
  void foobar(int *, int* __x)    ;
  int test_ints[30];
--- 1,5 ----
  /* { dg-lto-do run } */
! /* { dg-lto-options {{-flto -flto-partition=1to1 -fPIC}} } */
  /* { dg-suppress-ld-options {-fPIC} }  */
  void foobar(int *, int* __x)    ;
  int test_ints[30];
Index: testsuite/g++.dg/lto/20100723-1_0.C
===================================================================
*** testsuite/g++.dg/lto/20100723-1_0.C	(revision 166616)
--- testsuite/g++.dg/lto/20100723-1_0.C	(working copy)
***************
*** 1,5 ****
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-fcompare-debug -flto} {-fcompare-debug -fwhopr}} } */
  
  struct S {
      virtual void f() { }
--- 1,5 ----
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-fcompare-debug -flto -flto-partition=none} {-fcompare-debug -flto -flto-partition=1to1}} } */
  
  struct S {
      virtual void f() { }
Index: testsuite/g++.dg/lto/pr45679-1_0.C
===================================================================
*** testsuite/g++.dg/lto/pr45679-1_0.C	(revision 166616)
--- testsuite/g++.dg/lto/pr45679-1_0.C	(working copy)
***************
*** 1,6 ****
  // { dg-lto-do link }
  // { dg-lto-options {{-O3 -Wno-multichar}} } 
! // { dg-extra-ld-options "-fwhopr -r -nostdlib" }
  
       extern "C" {
     typedef struct __locale_struct {
--- 1,6 ----
  // { dg-lto-do link }
  // { dg-lto-options {{-O3 -Wno-multichar}} } 
! // { dg-extra-ld-options "-flto -flto-partition=1to1 -r -nostdlib" }
  
       extern "C" {
     typedef struct __locale_struct {
Index: testsuite/g++.dg/lto/20090128_0.C
===================================================================
*** testsuite/g++.dg/lto/20090128_0.C	(revision 166616)
--- testsuite/g++.dg/lto/20090128_0.C	(working copy)
***************
*** 1,5 ****
  // { dg-lto-do assemble }
! // { dg-lto-options {{-fpreprocessed -O2 -fwhopr -funsigned-char}} }
  typedef unsigned char uint8;
  extern const uint8 array[256];
  static inline bool
--- 1,5 ----
  // { dg-lto-do assemble }
! // { dg-lto-options {{-fpreprocessed -O2 -flto -flto-partition=1to1 -funsigned-char}} }
  typedef unsigned char uint8;
  extern const uint8 array[256];
  static inline bool
Index: testsuite/g++.dg/lto/20081204-2_0.C
===================================================================
*** testsuite/g++.dg/lto/20081204-2_0.C	(revision 166616)
--- testsuite/g++.dg/lto/20081204-2_0.C	(working copy)
***************
*** 1,5 ****
  // { dg-lto-do link }
! // { dg-lto-options {{-fwhopr -O3}} }
  extern void foo (void);
  
  int
--- 1,5 ----
  // { dg-lto-do link }
! // { dg-lto-options {{-flto -flto-partition=1to1 -O3}} }
  extern void foo (void);
  
  int
Index: testsuite/g++.dg/lto/20090302_0.C
===================================================================
*** testsuite/g++.dg/lto/20090302_0.C	(revision 166616)
--- testsuite/g++.dg/lto/20090302_0.C	(working copy)
***************
*** 1,5 ****
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-fPIC -fwhopr -r -nostdlib}} } */
  struct Foo {
    bool Mumble();
    static void Bar() { if (foo_->Mumble()) foo_ = 0; }
--- 1,5 ----
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-fPIC -flto -flto-partition=1to1 -r -nostdlib}} } */
  struct Foo {
    bool Mumble();
    static void Bar() { if (foo_->Mumble()) foo_ = 0; }
Index: testsuite/g++.dg/lto/20081119-1_0.C
===================================================================
*** testsuite/g++.dg/lto/20081119-1_0.C	(revision 166616)
--- testsuite/g++.dg/lto/20081119-1_0.C	(working copy)
***************
*** 1,5 ****
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-fPIC -fwhopr -r -nostdlib}} } */
  
  #include "20081119-1.h"
  
--- 1,5 ----
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-fPIC -flto -flto-partition=1to1 -r -nostdlib}} } */
  
  #include "20081119-1.h"
  
Index: testsuite/g++.dg/lto/20081118_0.C
===================================================================
*** testsuite/g++.dg/lto/20081118_0.C	(revision 166616)
--- testsuite/g++.dg/lto/20081118_0.C	(working copy)
***************
*** 1,5 ****
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-fPIC -fwhopr -r -nostdlib}} } */
  
  /* We used to ICE because of dangling pointers.  */
  
--- 1,5 ----
  /* { dg-lto-do link } */
! /* { dg-lto-options {{-fPIC -flto -flto-partition=1to1 -r -nostdlib}} } */
  
  /* We used to ICE because of dangling pointers.  */
  
Index: testsuite/g++.dg/20090121-1.C
===================================================================
*** testsuite/g++.dg/20090121-1.C	(revision 166616)
--- testsuite/g++.dg/20090121-1.C	(working copy)
***************
*** 1,6 ****
  // { dg-do compile }
  // { dg-require-effective-target lto }
! // { dg-options "-fwhopr -Wuninitialized -O2" }
  class A
  {
  private:
--- 1,6 ----
  // { dg-do compile }
  // { dg-require-effective-target lto }
! // { dg-options "-flto -Wuninitialized -O2" }
  class A
  {
  private:
Index: testsuite/objc.dg/lto/lto.exp
===================================================================
*** testsuite/objc.dg/lto/lto.exp	(revision 166616)
--- testsuite/objc.dg/lto/lto.exp	(working copy)
*************** if { ![check_effective_target_lto] } {
*** 41,50 ****
  global LTO_OPTIONS
  
  set LTO_OPTIONS [list	\
!   {-O0 -fwhopr -fgnu-runtime}	\
!   {-O2 -fwhopr -fgnu-runtime}	\
!   {-O0 -flto -fgnu-runtime} 	\
    {-O2 -flto -fgnu-runtime}	\
  ]
  
  objc_init
--- 41,50 ----
  global LTO_OPTIONS
  
  set LTO_OPTIONS [list	\
!   {-O0 -flto -fgnu-runtime}	\
    {-O2 -flto -fgnu-runtime}	\
+   {-O0 -flto -flto-partition=none -fgnu-runtime} 	\
+   {-O2 -flto -flto-partition=none -fgnu-runtime}	\
  ]
  
  objc_init
*************** foreach src $tests {
*** 67,76 ****
  # darwin targets can also run code with the NeXT runtime.
  if [istarget "*-*-darwin*" ] {
  set LTO_OPTIONS [list	\
!   {-O0 -fwhopr -fnext-runtime}	\
!   {-O2 -fwhopr -fnext-runtime}	\
!   {-O0 -flto -fnext-runtime} 	\
    {-O2 -flto -fnext-runtime}	\
  ]
    foreach src $tests {
      # If we're only testing specific files and this isn't one of them, skip it.
--- 67,76 ----
  # darwin targets can also run code with the NeXT runtime.
  if [istarget "*-*-darwin*" ] {
  set LTO_OPTIONS [list	\
!   {-O0 -flto -fnext-runtime}	\
    {-O2 -flto -fnext-runtime}	\
+   {-O0 -flto -flto-partition=none -fnext-runtime} 	\
+   {-O2 -flto -flto-partition=none -fnext-runtime}	\
  ]
    foreach src $tests {
      # If we're only testing specific files and this isn't one of them, skip it.
Index: testsuite/lib/lto.exp
===================================================================
*** testsuite/lib/lto.exp	(revision 166616)
--- testsuite/lib/lto.exp	(working copy)
*************** proc lto_init { args } {
*** 64,71 ****
      # add it to site.exp directly.
      if ![info exists LTO_OPTIONS] {
  	set LTO_OPTIONS [list	\
! 	    {-O0 -fwhopr}	\
! 	    {-O2 -fwhopr}	\
  	    {-O0 -flto}		\
  	    {-O2 -flto}		\
  	]
--- 64,73 ----
      # add it to site.exp directly.
      if ![info exists LTO_OPTIONS] {
  	set LTO_OPTIONS [list	\
! 	    {-O0 -flto -flto-partition=none } \
! 	    {-O2 -flto -flto-partition=none } \
! 	    {-O0 -flto -flto-partition=1to1 } \
! 	    {-O2 -flto -flto-partition=1to1 } \
  	    {-O0 -flto}		\
  	    {-O2 -flto}		\
  	]
Index: testsuite/lib/gcc-dg.exp
===================================================================
*** testsuite/lib/gcc-dg.exp	(revision 166616)
--- testsuite/lib/gcc-dg.exp	(working copy)
*************** if [info exists ADDITIONAL_TORTURE_OPTIO
*** 70,77 ****
  set LTO_TORTURE_OPTIONS ""
  if [check_effective_target_lto] {
      set LTO_TORTURE_OPTIONS [list \
! 	{ -O2 -flto } \
! 	{ -O2 -fwhopr }
      ]
  }
  
--- 70,77 ----
  set LTO_TORTURE_OPTIONS ""
  if [check_effective_target_lto] {
      set LTO_TORTURE_OPTIONS [list \
! 	{ -O2 -flto -flto-partition=none } \
! 	{ -O2 -flto }
      ]
  }
  
Index: testsuite/lib/c-torture.exp
===================================================================
*** testsuite/lib/c-torture.exp	(revision 166616)
--- testsuite/lib/c-torture.exp	(working copy)
*************** if [info exists ADDITIONAL_TORTURE_OPTIO
*** 53,60 ****
  set LTO_TORTURE_OPTIONS ""
  if [check_effective_target_lto] {
      set LTO_TORTURE_OPTIONS [list \
! 	{ -O2 -flto } \
! 	{ -O2 -fwhopr }
      ]
  }
  
--- 53,60 ----
  set LTO_TORTURE_OPTIONS ""
  if [check_effective_target_lto] {
      set LTO_TORTURE_OPTIONS [list \
! 	{ -O2 -flto -flto-partition=none } \
! 	{ -O2 -flto }
      ]
  }
  
Index: testsuite/obj-c++.dg/lto/lto.exp
===================================================================
*** testsuite/obj-c++.dg/lto/lto.exp	(revision 166616)
--- testsuite/obj-c++.dg/lto/lto.exp	(working copy)
*************** if { ![check_effective_target_lto] } {
*** 41,50 ****
  global LTO_OPTIONS
  
  set LTO_OPTIONS [list	\
!   {-O0 -fwhopr -fgnu-runtime}	\
!   {-O2 -fwhopr -fgnu-runtime}	\
!   {-O0 -flto -fgnu-runtime} 	\
    {-O2 -flto -fgnu-runtime}	\
  ]
  
  obj-c++_init
--- 41,50 ----
  global LTO_OPTIONS
  
  set LTO_OPTIONS [list	\
!   {-O0 -flto -fgnu-runtime}	\
    {-O2 -flto -fgnu-runtime}	\
+   {-O0 -flto -flto-partition=none -fgnu-runtime} 	\
+   {-O2 -flto -flto-partition=none -fgnu-runtime}	\
  ]
  
  obj-c++_init
*************** foreach src $tests {
*** 67,76 ****
  # darwin targets can also run code with the NeXT runtime.
  if [istarget "*-*-darwin*" ] {
  set LTO_OPTIONS [list	\
!   {-O0 -fwhopr -fnext-runtime}	\
!   {-O2 -fwhopr -fnext-runtime}	\
!   {-O0 -flto -fnext-runtime} 	\
    {-O2 -flto -fnext-runtime}	\
  ]
    foreach src $tests {
      # If we're only testing specific files and this isn't one of them, skip it.
--- 67,76 ----
  # darwin targets can also run code with the NeXT runtime.
  if [istarget "*-*-darwin*" ] {
  set LTO_OPTIONS [list	\
!   {-O0 -flto -fnext-runtime}	\
    {-O2 -flto -fnext-runtime}	\
+   {-O0 -flto -flto-partition=none -fnext-runtime} 	\
+   {-O2 -flto -flto-partition=none -fnext-runtime}	\
  ]
    foreach src $tests {
      # If we're only testing specific files and this isn't one of them, skip it.
Index: lto-wrapper.c
===================================================================
*** lto-wrapper.c	(revision 166616)
--- lto-wrapper.c	(working copy)
*************** along with GCC; see the file COPYING3.  
*** 32,38 ****
     The above will print something like
     /tmp/ccwbQ8B2.lto.o
  
!    If -fwhopr is used instead, more than one file might be produced
     ./ccXj2DTk.lto.ltrans.o
     ./ccCJuXGv.lto.ltrans.o
  */
--- 32,38 ----
     The above will print something like
     /tmp/ccwbQ8B2.lto.o
  
!    If WHOPR is used instead, more than one file might be produced
     ./ccXj2DTk.lto.ltrans.o
     ./ccCJuXGv.lto.ltrans.o
  */
*************** run_gcc (unsigned argc, char *argv[])
*** 304,309 ****
--- 304,310 ----
    bool seen_o = false;
    int parallel = 0;
    int jobserver = 0;
+   bool no_partition = false;
  
    /* Get the driver and options.  */
    collect_gcc = getenv ("COLLECT_GCC");
*************** run_gcc (unsigned argc, char *argv[])
*** 366,380 ****
  	if (strcmp (option, "-v") == 0)
  	  verbose = 1;
  
  	/* We've handled these LTO options, do not pass them on.  */
! 	if (strcmp (option, "-flto") == 0)
! 	  lto_mode = LTO_MODE_LTO;
! 	else if (strncmp (option, "-fwhopr", 7) == 0)
  	  {
  	    lto_mode = LTO_MODE_WHOPR;
! 	    if (option[7] == '=')
  	      {
! 		if (!strcmp (option + 8, "jobserver"))
  		  {
  		    jobserver = 1;
  		    parallel = 1;
--- 367,382 ----
  	if (strcmp (option, "-v") == 0)
  	  verbose = 1;
  
+ 	if (strcmp (option, "-flto-partition=none") == 0)
+ 	  no_partition = true;
  	/* We've handled these LTO options, do not pass them on.  */
! 	if (strncmp (option, "-flto=", 6) == 0
! 	    || !strcmp (option, "-flto"))
  	  {
  	    lto_mode = LTO_MODE_WHOPR;
! 	    if (option[5] == '=')
  	      {
! 		if (!strcmp (option + 6, "jobserver"))
  		  {
  		    jobserver = 1;
  		    parallel = 1;
*************** run_gcc (unsigned argc, char *argv[])
*** 390,395 ****
--- 392,403 ----
  	else
  	  *argv_ptr++ = option;
        }
+   if (no_partition)
+     {
+       lto_mode = LTO_MODE_LTO;
+       jobserver = 0;
+       parallel = 0;
+     }
  
    if (linker_output)
      {
Index: opts.c
===================================================================
*** opts.c	(revision 166616)
--- opts.c	(working copy)
*************** finish_options (struct gcc_options *opts
*** 1218,1224 ****
        opts->x_flag_ipa_struct_reorg = 0;
      }
  
!   if (opts->x_flag_lto || opts->x_flag_whopr)
      {
  #ifdef ENABLE_LTO
        opts->x_flag_generate_lto = 1;
--- 1218,1224 ----
        opts->x_flag_ipa_struct_reorg = 0;
      }
  
!   if (opts->x_flag_lto)
      {
  #ifdef ENABLE_LTO
        opts->x_flag_generate_lto = 1;
*************** finish_options (struct gcc_options *opts
*** 1231,1250 ****
        error ("LTO support has not been enabled in this configuration");
  #endif
      }
!   if (opts->x_flag_lto_partition_balanced || opts->x_flag_lto_partition_1to1)
      {
        if (opts->x_flag_lto_partition_balanced
  	  && opts->x_flag_lto_partition_1to1)
  	error ("only one -flto-partition value can be specified");
!       if (!opts->x_flag_whopr && !opts->x_flag_wpa && !opts->x_flag_ltrans)
! 	error ("-flto-partition has no effect without -fwhopr");
      }
  
-   /* Reconcile -flto and -fwhopr.  Set additional flags as appropriate and
-      check option consistency.  */
-   if (opts->x_flag_lto && opts->x_flag_whopr)
-     error ("-flto and -fwhopr are mutually exclusive");
- 
    /* We initialize opts->x_flag_split_stack to -1 so that targets can set a
       default value if they choose based on other options.  */
    if (opts->x_flag_split_stack == -1)
--- 1231,1246 ----
        error ("LTO support has not been enabled in this configuration");
  #endif
      }
!   if ((opts->x_flag_lto_partition_balanced != 0) + (opts->x_flag_lto_partition_1to1 != 0)
!        + (opts->x_flag_lto_partition_none != 0) > 1)
      {
        if (opts->x_flag_lto_partition_balanced
  	  && opts->x_flag_lto_partition_1to1)
  	error ("only one -flto-partition value can be specified");
!       if (!opts->x_flag_lto && !opts->x_flag_wpa && !opts->x_flag_ltrans)
! 	error ("-flto-partition has no effect without -flto");
      }
  
    /* We initialize opts->x_flag_split_stack to -1 so that targets can set a
       default value if they choose based on other options.  */
    if (opts->x_flag_split_stack == -1)
*************** common_handle_option (struct gcc_options
*** 2152,2159 ****
        dc->pedantic_errors = 1;
        break;
  
!     case OPT_fwhopr:
!       opts->x_flag_whopr = "";
        break;
  
      case OPT_w:
--- 2148,2155 ----
        dc->pedantic_errors = 1;
        break;
  
!     case OPT_flto:
!       opts->x_flag_lto = "";
        break;
  
      case OPT_w:
Index: ipa-split.c
===================================================================
*** ipa-split.c	(revision 166616)
--- ipa-split.c	(working copy)
*************** execute_split_functions (void)
*** 1251,1257 ****
       then inlining would still benefit.  */
    if ((!node->callers || !node->callers->next_caller)
        && !node->address_taken
!       && ((!flag_lto && !flag_whopr) || !node->local.externally_visible))
      {
        if (dump_file)
  	fprintf (dump_file, "Not splitting: not called directly "
--- 1251,1257 ----
       then inlining would still benefit.  */
    if ((!node->callers || !node->callers->next_caller)
        && !node->address_taken
!       && (!flag_lto || !node->local.externally_visible))
      {
        if (dump_file)
  	fprintf (dump_file, "Not splitting: not called directly "
Index: ipa.c
===================================================================
*** ipa.c	(revision 166616)
--- ipa.c	(working copy)
*************** function_and_variable_visibility (bool w
*** 938,944 ****
  static unsigned int
  local_function_and_variable_visibility (void)
  {
!   return function_and_variable_visibility (flag_whole_program && !flag_lto && !flag_whopr);
  }
  
  struct simple_ipa_opt_pass pass_ipa_function_and_variable_visibility =
--- 938,944 ----
  static unsigned int
  local_function_and_variable_visibility (void)
  {
!   return function_and_variable_visibility (flag_whole_program && !flag_lto);
  }
  
  struct simple_ipa_opt_pass pass_ipa_function_and_variable_visibility =
Index: ipa-prop.c
===================================================================
*** ipa-prop.c	(revision 166616)
--- ipa-prop.c	(working copy)
*************** ipa_compute_jump_functions (struct cgrap
*** 890,896 ****
      {
        /* We do not need to bother analyzing calls to unknown
  	 functions unless they may become known during lto/whopr.  */
!       if (!cs->callee->analyzed && !flag_lto && !flag_whopr)
  	continue;
        ipa_count_arguments (cs);
        /* If the descriptor of the callee is not initialized yet, we have to do
--- 890,896 ----
      {
        /* We do not need to bother analyzing calls to unknown
  	 functions unless they may become known during lto/whopr.  */
!       if (!cs->callee->analyzed && !flag_lto)
  	continue;
        ipa_count_arguments (cs);
        /* If the descriptor of the callee is not initialized yet, we have to do
Index: common.opt
===================================================================
*** common.opt	(revision 166616)
--- common.opt	(working copy)
*************** Common Ignore
*** 1138,1146 ****
  Does nothing.  Preserved for backward compatibility.
  
  flto
! Common Var(flag_lto)
  Enable link-time optimization.
  
  flto-partition=1to1
  Common Var(flag_lto_partition_1to1)
  Partition functions and vars at linktime based on object files they originate from
--- 1138,1150 ----
  Does nothing.  Preserved for backward compatibility.
  
  flto
! Common
  Enable link-time optimization.
  
+ flto=
+ Common RejectNegative Joined Var(flag_lto)
+ Link-time optimization with number of parallel jobs or jobserver.
+ 
  flto-partition=1to1
  Common Var(flag_lto_partition_1to1)
  Partition functions and vars at linktime based on object files they originate from
*************** flto-partition=balanced
*** 1149,1154 ****
--- 1153,1162 ----
  Common Var(flag_lto_partition_balanced)
  Partition functions and vars at linktime into approximately same sized buckets
  
+ flto-partition=none
+ Common Var(flag_lto_partition_none)
+ Disable partioning and streaming
+ 
  ; The initial value of -1 comes from Z_DEFAULT_COMPRESSION in zlib.h.
  flto-compression-level=
  Common Joined RejectNegative UInteger Var(flag_lto_compression_level) Init(-1)
*************** fweb
*** 1879,1892 ****
  Common Report Var(flag_web) Init(2) Optimization
  Construct webs and split unrelated uses of single variable
  
- fwhopr
- Common
- Enable partitioned link-time optimization
- 
- fwhopr=
- Common RejectNegative Joined Var(flag_whopr)
- Partitioned link-time optimization with number of parallel jobs or jobserver.
- 
  ftree-builtin-call-dce
  Common Report Var(flag_tree_builtin_call_dce) Init(0) Optimization
  Enable conditional dead code elimination for builtin calls
--- 1887,1892 ----
Index: varpool.c
===================================================================
*** varpool.c	(revision 166616)
--- varpool.c	(working copy)
*************** decide_is_variable_needed (struct varpoo
*** 343,349 ****
    if (TREE_PUBLIC (decl)
        && !flag_whole_program
        && !flag_lto
-       && !flag_whopr
        && !DECL_COMDAT (decl)
        && !DECL_EXTERNAL (decl))
      return true;
--- 343,348 ----
Index: collect2.c
===================================================================
*** collect2.c	(revision 166616)
--- collect2.c	(working copy)
*************** main (int argc, char **argv)
*** 1196,1216 ****
  
    /* Parse command line early for instances of -debug.  This allows
       the debug flag to be set before functions like find_a_file()
!      are called.  We also look for the -flto or -fwhopr flag to know
       what LTO mode we are in.  */
    {
      int i;
  
      for (i = 1; argv[i] != NULL; i ++)
        {
  	if (! strcmp (argv[i], "-debug"))
  	  debug = true;
!         else if (! strcmp (argv[i], "-flto") && ! use_plugin)
! 	  {
! 	    use_verbose = true;
! 	    lto_mode = LTO_MODE_LTO;
! 	  }
!         else if (! strncmp (argv[i], "-fwhopr", 7) && ! use_plugin)
  	  {
  	    use_verbose = true;
  	    lto_mode = LTO_MODE_WHOPR;
--- 1196,1215 ----
  
    /* Parse command line early for instances of -debug.  This allows
       the debug flag to be set before functions like find_a_file()
!      are called.  We also look for the -flto or -flto-partition=none flag to know
       what LTO mode we are in.  */
    {
      int i;
+     bool no_partition = false;
  
      for (i = 1; argv[i] != NULL; i ++)
        {
  	if (! strcmp (argv[i], "-debug"))
  	  debug = true;
!         else if (! strcmp (argv[i], "-flto-partition=none"))
! 	  no_partition = true;
!         else if ((! strncmp (argv[i], "-flto=", 6)
! 		  || ! strcmp (argv[i], "-flto")) && ! use_plugin)
  	  {
  	    use_verbose = true;
  	    lto_mode = LTO_MODE_WHOPR;
*************** main (int argc, char **argv)
*** 1239,1244 ****
--- 1238,1245 ----
  #endif
        }
      vflag = debug;
+     if (no_partition)
+       lto_mode = LTO_MODE_LTO;
    }
  
  #ifndef DEFAULT_A_OUT_NAME
*************** main (int argc, char **argv)
*** 1485,1492 ****
  	      break;
  
              case 'f':
! 	      if (strcmp (arg, "-flto") == 0
! 		  || strncmp (arg, "-fwhopr", 7) == 0)
  		{
  #ifdef ENABLE_LTO
  		  /* Do not pass LTO flag to the linker. */
--- 1486,1492 ----
  	      break;
  
              case 'f':
! 	      if (strncmp (arg, "-flto", 5) == 0)
  		{
  #ifdef ENABLE_LTO
  		  /* Do not pass LTO flag to the linker. */


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