(-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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166625
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-11-11 Jan Hubicka <jh@suse.cz>
+
+ * 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.
+
2010-11-11 Jan Hubicka <jh@suse.cz>
PR tree-optimize/40436
&& !(DECL_CONTEXT (decl)
&& TREE_CODE (DECL_CONTEXT (decl)) == FUNCTION_DECL)))
&& !flag_whole_program
- && !flag_lto
- && !flag_whopr)
+ && !flag_lto)
&& !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
return true;
/* 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
+ 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") && ! use_plugin)
- {
- use_verbose = true;
- lto_mode = LTO_MODE_LTO;
- }
- else if (! strncmp (argv[i], "-fwhopr", 7) && ! use_plugin)
+ 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;
#endif
}
vflag = debug;
+ if (no_partition)
+ lto_mode = LTO_MODE_LTO;
}
#ifndef DEFAULT_A_OUT_NAME
break;
case 'f':
- if (strcmp (arg, "-flto") == 0
- || strncmp (arg, "-fwhopr", 7) == 0)
+ if (strncmp (arg, "-flto", 5) == 0)
{
#ifdef ENABLE_LTO
/* Do not pass LTO flag to the linker. */
Does nothing. Preserved for backward compatibility.
flto
-Common Var(flag_lto)
+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
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)
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
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
+@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
+@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
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.
+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
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
+information. Combining @option{-flto} 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
for this to work. This will likely only work if @env{MAKE} is
GNU make.
-Disabled by default.
+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. The default value is @code{balanced}.
+chunks. Specifying @code{none} as an algorithm disables partitioning
+and streaming completely.
+The default value is @code{balanced}.
@item -fwpa
@opindex fwpa
/* 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
+/* 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 "\
%{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 \
+ %{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\
{
/* 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)
+ 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
then inlining would still benefit. */
if ((!node->callers || !node->callers->next_caller)
&& !node->address_taken
- && ((!flag_lto && !flag_whopr) || !node->local.externally_visible))
+ && (!flag_lto || !node->local.externally_visible))
{
if (dump_file)
fprintf (dump_file, "Not splitting: not called directly "
static unsigned int
local_function_and_variable_visibility (void)
{
- return function_and_variable_visibility (flag_whole_program && !flag_lto && !flag_whopr);
+ return function_and_variable_visibility (flag_whole_program && !flag_lto);
}
struct simple_ipa_opt_pass pass_ipa_function_and_variable_visibility =
The above will print something like
/tmp/ccwbQ8B2.lto.o
- If -fwhopr is used instead, more than one file might be produced
+ If WHOPR is used instead, more than one file might be produced
./ccXj2DTk.lto.ltrans.o
./ccCJuXGv.lto.ltrans.o
*/
bool seen_o = false;
int parallel = 0;
int jobserver = 0;
+ bool no_partition = false;
/* Get the driver and options. */
collect_gcc = getenv ("COLLECT_GCC");
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 (strcmp (option, "-flto") == 0)
- lto_mode = LTO_MODE_LTO;
- else if (strncmp (option, "-fwhopr", 7) == 0)
+ if (strncmp (option, "-flto=", 6) == 0
+ || !strcmp (option, "-flto"))
{
lto_mode = LTO_MODE_WHOPR;
- if (option[7] == '=')
+ if (option[5] == '=')
{
- if (!strcmp (option + 8, "jobserver"))
+ if (!strcmp (option + 6, "jobserver"))
{
jobserver = 1;
parallel = 1;
else
*argv_ptr++ = option;
}
+ if (no_partition)
+ {
+ lto_mode = LTO_MODE_LTO;
+ jobserver = 0;
+ parallel = 0;
+ }
if (linker_output)
{
opts->x_flag_ipa_struct_reorg = 0;
}
- if (opts->x_flag_lto || opts->x_flag_whopr)
+ if (opts->x_flag_lto)
{
#ifdef ENABLE_LTO
opts->x_flag_generate_lto = 1;
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 != 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)
+ if ((opts->x_flag_lto_partition_balanced != 0)
+ + (opts->x_flag_lto_partition_1to1 != 0)
+ + (opts->x_flag_lto_partition_none != 0) > 1)
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");
+ if (!opts->x_flag_lto && !opts->x_flag_wpa && !opts->x_flag_ltrans)
+ error ("-flto-partition has no effect without -flto");
}
- /* 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)
dc->pedantic_errors = 1;
break;
- case OPT_fwhopr:
- opts->x_flag_whopr = "";
+ case OPT_flto:
+ opts->x_flag_lto = "";
break;
case OPT_w:
+2010-11-11 Jan Hubicka <jh@suse.cz>
+
+ * 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.
+
2010-11-11 Jan Hubicka <jh@suse.cz>
PR tree-optimize/40436
/* { dg-do compile } */
/* { dg-require-effective-target lto } */
-/* { dg-options "-fwhopr -Wuninitialized -O1" } */
+/* { dg-options "-flto -Wuninitialized -O1" } */
template <typename T> struct Q1 { typedef int x; };
template <typename T> struct Q2 {
// { dg-do compile }
// { dg-require-effective-target lto }
-// { dg-options "-fwhopr -Wuninitialized -O2" }
+// { dg-options "-flto -Wuninitialized -O2" }
class A
{
private:
// { dg-lto-do link }
-// { dg-lto-options {{-fPIC -fwhopr}} }
-// { dg-extra-ld-options "-fPIC -fwhopr -r -nostdlib -fno-exceptions" }
+// { 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) { } };
/* { dg-lto-do link } */
-/* { dg-lto-options {{-fPIC -fwhopr -r -nostdlib}} } */
+/* { dg-lto-options {{-fPIC -flto -flto-partition=1to1 -r -nostdlib}} } */
/* We used to ICE because of dangling pointers. */
/* { dg-lto-do link } */
-/* { dg-lto-options {{-fPIC -fwhopr -r -nostdlib}} } */
+/* { dg-lto-options {{-fPIC -flto -flto-partition=1to1 -r -nostdlib}} } */
#include "20081119-1.h"
// { dg-lto-do link }
-// { dg-lto-options {{-fwhopr -r -nostdlib -fPIC}} }
+// { dg-lto-options {{-flto -flto-partition=1to1 -r -nostdlib -fPIC}} }
int
f(void)
// { dg-lto-do link }
-// { dg-lto-options {{-fwhopr}} }
+// { dg-lto-options {{-flto -flto-partition=1to1}} }
#include "20081125.h"
object::object (int x)
/* { dg-lto-do link } */
-/* { dg-lto-options {{-fwhopr -fPIC -r -nostdlib}} } */
+/* { 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
// { dg-lto-do link }
-// { dg-lto-options {{-fwhopr -O3}} }
+// { dg-lto-options {{-flto -flto-partition=1to1 -O3}} }
extern void foo (void);
int
// { dg-lto-do link }
-// { dg-lto-options {{-fPIC -fwhopr -O2}} }
-// { dg-extra-ld-options "-O2 -fPIC -fwhopr -r -nostdlib" }
+// { 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"
// { dg-lto-do assemble }
-// { dg-lto-options {{-fpreprocessed -O2 -fwhopr -funsigned-char}} }
+// { dg-lto-options {{-fpreprocessed -O2 -flto -flto-partition=1to1 -funsigned-char}} }
typedef unsigned char uint8;
extern const uint8 array[256];
static inline bool
/* { dg-lto-do link } */
-/* { dg-lto-options {{-fPIC -fwhopr -r -nostdlib}} } */
+/* { dg-lto-options {{-fPIC -flto -flto-partition=1to1 -r -nostdlib}} } */
struct Foo {
bool Mumble();
static void Bar() { if (foo_->Mumble()) foo_ = 0; }
/* { dg-lto-do run } */
-/* { dg-lto-options {{-fwhopr -fPIC}} } */
+/* { dg-lto-options {{-flto -flto-partition=1to1 -fPIC}} } */
/* { dg-suppress-ld-options {-fPIC} } */
void foobar(int *, int* __x) ;
int test_ints[30];
// { dg-lto-do link }
-// { dg-lto-options {{-fwhopr -fPIC}} }
-// { dg-extra-ld-options "-fwhopr -r -nostdlib" }
+// { dg-lto-options {{-flto -flto-partition=1to1 -fPIC}} }
+// { dg-extra-ld-options "-flto -flto-partition=1to1 -r -nostdlib" }
int X;
/* { dg-lto-do link } */
-/* { dg-lto-options {{-fcompare-debug -flto} {-fcompare-debug -fwhopr}} } */
+/* { dg-lto-options {{-fcompare-debug -flto -flto-partition=none} {-fcompare-debug -flto -flto-partition=1to1}} } */
struct S {
virtual void f() { }
/* { dg-lto-do link } */
-/* { dg-lto-options {{-ftoplevel-reorder -flto} {-ftoplevel-reorder -fwhopr}} } */
+/* { 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(); };
// { dg-lto-do link }
// { dg-lto-options {{-O3 -Wno-multichar}} }
-// { dg-extra-ld-options "-fwhopr -r -nostdlib" }
+// { dg-extra-ld-options "-flto -flto-partition=1to1 -r -nostdlib" }
extern "C" {
typedef struct __locale_struct {
// { dg-lto-do link }
// { dg-lto-options {{-O3 -Wno-multichar}} }
-// { dg-extra-ld-options "-fwhopr -r -nostdlib" }
+// { dg-extra-ld-options "-flto -flto-partition=1to1 -r -nostdlib" }
extern "C" {
typedef struct {
union {
/* { dg-do compile } */
-/* { dg-options "-fwhopr" { target lto } } */
+/* { dg-options "-flto" { target lto } } */
typedef struct foo_ foo_t;
foo_t bar; /* { dg-error "storage size of 'bar' isn't known" } */
-/* { dg-lto-options {{-O2 -DOPTIMIZE -fwhopr} {-O0 -fwhopr}} } */
+/* { dg-lto-options {{-O2 -DOPTIMIZE -flto -flto-partition=1to1} {-O0 -flto -flto-partition=1to1}} } */
extern void abort (void);
-/* { dg-lto-options {{-O2 -DOPTIMIZE -fwhopr} {-O0 -fwhopr}} } */
+/* { dg-lto-options {{-O2 -DOPTIMIZE -flto -flto-partition=1to1} {-O0 -flto -flto-partition=1to1}} } */
extern void abort (void);
extern int f (void);
/* { dg-lto-do link } */
-/* { dg-lto-options {{-fwhopr -r -nostdlib}} } */
+/* { dg-lto-options {{-flto -flto-partition=1to1 -r -nostdlib}} } */
void bar(void) {}
-/* { dg-lto-options {{-O2 -DOPTIMIZE -fwhopr} {-O0 -fwhopr}} } */
+/* { dg-lto-options {{-O2 -DOPTIMIZE -flto -flto-partition=1to1} {-O0 -flto -flto-partition=1to1}} } */
extern void abort (void);
-/* { dg-lto-options {{-O3 -fwhopr}} } */
+/* { dg-lto-options {{-O3 -flto -flto-partition=1to1}} } */
/* Test that cross-TU inlining works. */
-/* { dg-lto-options {{-fwhopr -O3}} } */
+/* { dg-lto-options {{-flto -flto-partition=1to1 -O3}} } */
extern void exit (int);
extern void foo (void);
-/* { dg-lto-options {{-fwhopr -O3}} } */
+/* { dg-lto-options {{-flto -flto-partition=1to1 -O3}} } */
extern void exit (int);
extern void *foo (void);
/* { dg-lto-do link } */
-/* { dg-lto-options {{-fwhopr -fPIC -r -nostdlib}} } */
+/* { 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 */
/* { dg-lto-do link } */
-/* { dg-lto-options {{-fwhopr -r -nostdlib -fPIC}} } */
+/* { dg-lto-options {{-flto -flto-partition=1to1 -r -nostdlib -fPIC}} } */
#include "20081224_0.h"
extern struct foo x;
/* { dg-lto-do link } */
-/* { dg-lto-options {{-O1 -fwhopr -fPIC}} } */
+/* { dg-lto-options {{-O1 -flto -flto-partition=1to1 -fPIC}} } */
/* { dg-extra-ld-options {-r -nostdlib -O0} } */
int foo(void) {
/* { dg-lto-do link } */
-/* { dg-lto-options {{-O0 -fwhopr}} } */
-/* { dg-extra-ld-options {-r -nostdlib -O2 -fwhopr} } */
+/* { 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;
/* { dg-lto-do link } */
-/* { dg-lto-options {{-fPIC -O2 -fwhopr}} } */
-/* { dg-extra-ld-options {-fno-PIC -r -nostdlib -O2 -fwhopr} } */
+/* { 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;
/* { dg-lto-do link } */
/* { dg-skip-if "" { ! { i?86-*-linux* x86_64-*-linux* } } { "*" } { "" } } */
-/* { dg-lto-options {{-fPIC -r -nostdlib -fwhopr -msse2}} } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -flto -flto-partition=1to1 -msse2}} } */
/* { dg-require-effective-target sse2 } */
/* { dg-suppress-ld-options {-fPIC -msse2} } */
/* { dg-lto-do link } */
/* { dg-skip-if "" { ! { i?86-*-linux* x86_64-*-linux* } } { "*" } { "" } } */
-/* { dg-lto-options {{-fwhopr -fPIC}} } */
+/* { dg-lto-options {{-flto -flto-partition=1to1 -fPIC}} } */
/* { dg-suppress-ld-options {-fPIC} } */
void func(int n) {
/* { dg-lto-do link } */
-/* { dg-lto-options {{-O3 -fwhopr -fPIC -r -nostdlib}} } */
+/* { dg-lto-options {{-O3 -flto -flto-partition=1to1 -fPIC -r -nostdlib}} } */
struct Foo { int f1, f2, f3, f4, f5; };
/* { dg-lto-do link } */
-/* { dg-lto-options {{-fPIC -r -nostdlib -O2 -flto} {-fPIC -r -nostdlib -O2 -fwhopr}} } */
+/* { 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; }
/* { dg-lto-do run } */
-/* { dg-lto-options {{-O2 -flto}} } */
+/* { dg-lto-options {{-O2 -flto -flto-partition=none}} } */
struct bar {int x;};
extern struct bar foo(void);
/* { dg-lto-do link } */
-/* { dg-lto-options {{-O2 -flto} {-O2 -fwhopr} {-O3 -flto} {-O3 -fwhopr}} } */
+/* { 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>
/* The 3 constant initializers should be uniquized. */
/* { dg-lto-do run } */
-/* { dg-lto-options {{-Os -flto} {-Os -fwhopr} } } */
+/* { dg-lto-options {{-Os -flto -flto-partition=none} {-Os -flto -flto-partition=1to1} } } */
int lookup1 (int i)
{
-/* { dg-lto-options {{ -O1 -fwhopr -fipa-cp -fipa-cp-clone}} } */
+/* { 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. */
-/* { dg-lto-options {{ -O1 -fwhopr -fwhole-program}} } */
+/* { 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
-/* { dg-lto-options {{ -O1 -fwhopr }} } */
+/* { 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
-/* { dg-lto-options {{ -O3 -fwhopr}} } */
+/* { dg-lto-options {{ -O3 -flto -flto-partition=1to1}} } */
/* { dg-lto-do run } */
extern void clone_me (int, int);
int a=15;
/* { dg-lto-do run } */
-/* { dg-lto-options {{-O2 -fwhopr} } } */
+/* { dg-lto-options {{-O2 -flto -flto-partition=1to1} } } */
void exit (int);
__attribute__ ((noreturn))
set LTO_TORTURE_OPTIONS ""
if [check_effective_target_lto] {
set LTO_TORTURE_OPTIONS [list \
- { -O2 -flto } \
- { -O2 -fwhopr }
+ { -O2 -flto -flto-partition=none } \
+ { -O2 -flto }
]
}
set LTO_TORTURE_OPTIONS ""
if [check_effective_target_lto] {
set LTO_TORTURE_OPTIONS [list \
- { -O2 -flto } \
- { -O2 -fwhopr }
+ { -O2 -flto -flto-partition=none } \
+ { -O2 -flto }
]
}
# add it to site.exp directly.
if ![info exists LTO_OPTIONS] {
set LTO_OPTIONS [list \
- {-O0 -fwhopr} \
- {-O2 -fwhopr} \
+ {-O0 -flto -flto-partition=none } \
+ {-O2 -flto -flto-partition=none } \
+ {-O0 -flto -flto-partition=1to1 } \
+ {-O2 -flto -flto-partition=1to1 } \
{-O0 -flto} \
{-O2 -flto} \
]
global LTO_OPTIONS
set LTO_OPTIONS [list \
- {-O0 -fwhopr -fgnu-runtime} \
- {-O2 -fwhopr -fgnu-runtime} \
- {-O0 -flto -fgnu-runtime} \
+ {-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
# 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} \
+ {-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.
global LTO_OPTIONS
set LTO_OPTIONS [list \
- {-O0 -fwhopr -fgnu-runtime} \
- {-O2 -fwhopr -fgnu-runtime} \
- {-O0 -flto -fgnu-runtime} \
+ {-O0 -flto -fgnu-runtime} \
{-O2 -flto -fgnu-runtime} \
+ {-O0 -flto -flto-partition=none -fgnu-runtime} \
+ {-O2 -flto -flto-partition=none -fgnu-runtime} \
]
objc_init
# 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} \
+ {-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.
if (TREE_PUBLIC (decl)
&& !flag_whole_program
&& !flag_lto
- && !flag_whopr
&& !DECL_COMDAT (decl)
&& !DECL_EXTERNAL (decl))
return true;