aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2018-05-30 18:42:41 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2018-05-30 16:42:41 +0000
commit5b42d196248425064ca9013f63510834744e169e (patch)
treeab2fb9dcd8a2e6aacec01cadb11d9ff8a8525399 /gcc/lto
parent6c363ddd67f5fc1a44d285100560d830ee04f630 (diff)
downloadgcc-5b42d196248425064ca9013f63510834744e169e.zip
gcc-5b42d196248425064ca9013f63510834744e169e.tar.gz
gcc-5b42d196248425064ca9013f63510834744e169e.tar.bz2
passes.c (ipa_write_summaries): Only modify statements if body is in memory.
* passes.c (ipa_write_summaries): Only modify statements if body is in memory. * cgraphunit.c (ipa_passes): Also produce intermeidate code when incrementally linking. (ipa_passes): Likewise. * lto-cgraph.c (lto_output_node): When incrementally linking do not pass down resolution info. * common.opt (flag_incremental_link): Update info. * gcc.c (plugin specs): Turn flinker-output=* to -plugin-opt=-linker-output-known * toplev.c (compile_file): Also cut compilation when doing incremental link. * flag-types. (enum lto_partition_model): Add LTO_LINKER_OUTPUT_NOLTOREL. (invoke.texi): Add -flinker-output docs. * ipa.c (symbol_table::remove_unreachable_nodes): Handle LTO incremental link same way as WPA; do not stream in dead initializers. * dwarf2out.c (dwarf2out_die_ref_for_decl, darf2out_register_external_decl): Support incremental link. * lang.opt (lto_linker_output): Add nolto-rel. * lto-lang.c (lto_post_options): Handle LTO_LINKER_OUTPUT_REL and LTO_LINKER_OUTPUT_NOLTOREL. (lto_init): Generate lto when doing incremental link. * lto.c (lto_precess_name): Add lto1-inclink. * testsuite/g++.dg/lto/20081109-1_0.C: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/20081118_0.C: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/20081119-1_0.C: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/20081120-1_0.C: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/20081120-2_0.C: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/20081123_0.C: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/20081204-1_0.C: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/20081219_0.C: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/20090302_0.C: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/20090313_0.C: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/20091002-2_0.C: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/20091002-3_0.C: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/20091026-1_0.C: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/20100724-1_0.C: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/20101010-4_0.C: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/20101015-2_0.C: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/20110311-1_0.C: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/pr45621_0.C: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/pr48042_0.C: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/pr48354-1_0.C: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/pr54625-1_0.c: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/pr54625-2_0.c: Add -flinker-output=nolto-rel. * testsuite/g++.dg/lto/pr68811_0.C: Add -flinker-output=nolto-rel. * testsuite/g++.dg/torture/pr43760.C: New test. Add -flinker-output=nolto-rel. * testsuite/gcc.dg/lto/20081120-1_0.c: Add -flinker-output=nolto-rel. * testsuite/gcc.dg/lto/20081120-2_0.c: Add -flinker-output=nolto-rel. * testsuite/gcc.dg/lto/20081126_0.c: Add -flinker-output=nolto-rel. * testsuite/gcc.dg/lto/20081204-1_0.c: Add -flinker-output=nolto-rel. * testsuite/gcc.dg/lto/20081204-2_0.c: Add -flinker-output=nolto-rel. * testsuite/gcc.dg/lto/20081212-1_0.c: Add -flinker-output=nolto-rel. * testsuite/gcc.dg/lto/20081224_0.c: Add -flinker-output=nolto-rel. * testsuite/gcc.dg/lto/20090116_0.c: Add -flinker-output=nolto-rel. * testsuite/gcc.dg/lto/20090126-1_0.c: Add -flinker-output=nolto-rel. * testsuite/gcc.dg/lto/20090126-2_0.c: Add -flinker-output=nolto-rel. * testsuite/gcc.dg/lto/20090206-1_0.c: Add -flinker-output=nolto-rel. * testsuite/gcc.dg/lto/20090219_0.c: Add -flinker-output=nolto-rel. * testsuite/gcc.dg/lto/20091013-1_0.c: Add -flinker-output=nolto-rel. * testsuite/gcc.dg/lto/20091014-1_0.c: Add -flinker-output=nolto-rel. * testsuite/gcc.dg/lto/20091015-1_0.c: Add -flinker-output=nolto-rel. * testsuite/gcc.dg/lto/20091016-1_0.c: Add -flinker-output=nolto-rel. * testsuite/gcc.dg/lto/20091020-1_0.c: Add -flinker-output-nolto-rel. * testsuite/gcc.dg/lto/20091020-2_0.c: Add -flinker-output-nolto-rel. * testsuite/gcc.dg/lto/20091027-1_0.c: Add -flinker-output-nolto-rel. * testsuite/gcc.dg/lto/20100426_0.c: Add -flinker-output-nolto-rel. * testsuite/gcc.dg/lto/20100430-1_0.c: Add -flinker-output-nolto-rel. * testsuite/gcc.dg/lto/20100603-1_0.c: Add -flinker-output-nolto-rel. * testsuite/gcc.dg/lto/20100603-2_0.c: Add -flinker-output-nolto-rel. * testsuite/gcc.dg/lto/20100603-3_0.c: Add -flinker-output-nolto-rel. * testsuite/gcc.dg/lto/20111213-1_0.c: Add -flinker-output-nolto-rel. * testsuite/gcc.dg/lto/pr45736_0.c: Add -flinker-output-nolto-rel. * testsuite/gcc.dg/lto/pr52634_0.c: Add -flinker-output-nolto-rel. * testsuite/gcc.dg/lto/pr54702_0.c: Add -flinker-output-nolto-rel. * testsuite/gcc.dg/lto/pr59323-2_0.c: Add -flinker-output-nolto-rel. * testsuite/gcc.dg/lto/pr59323_0.c: Add -flinker-output-nolto-rel. * testsuite/gcc.dg/lto/pr60820_0.c: Add -flinker-output-nolto-rel. * testsuite/gcc.dg/lto/pr81406_0.c: Add -flinker-output-nolto-rel. * testsuite/gcc.dg/lto/pr83388_0.c: Add -flinker-output-nolto-rel. * testsuite/gfortran.dg/lto/20091016-1_0.f90: Add -flinker-output-nolto-rel. * testsuite/gfortran.dg/lto/20091028-1_0.f90: Add -flinker-output-nolto-rel. * testsuite/gfortran.dg/lto/20091028-2_0.f90: Add -flinker-output-nolto-rel. * testsuite/gfortran.dg/lto/pr46911_0.f: Add -flinker-output-nolto-rel. * testsuite/gfortran.dg/lto/pr47839_0.f90: Add -flinker-output-nolto-rel. From-SVN: r260963
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog8
-rw-r--r--gcc/lto/lang.opt3
-rw-r--r--gcc/lto/lto-lang.c25
-rw-r--r--gcc/lto/lto.c3
4 files changed, 36 insertions, 3 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index cd976fa..5e1e0a9 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,11 @@
+2018-05-30 Jan Hubicka <hubicka@ucw.cz>
+
+ * lang.opt (lto_linker_output): Add nolto-rel.
+ * lto-lang.c (lto_post_options): Handle LTO_LINKER_OUTPUT_REL
+ and LTO_LINKER_OUTPUT_NOLTOREL.
+ (lto_init): Generate lto when doing incremental link.
+ * lto.c (lto_precess_name): Add lto1-inclink.
+
2018-05-18 Jan Hubicka <jh@suse.cz>
PR lto/85583
diff --git a/gcc/lto/lang.opt b/gcc/lto/lang.opt
index 0a408d3..1d280a8 100644
--- a/gcc/lto/lang.opt
+++ b/gcc/lto/lang.opt
@@ -34,6 +34,9 @@ EnumValue
Enum(lto_linker_output) String(rel) Value(LTO_LINKER_OUTPUT_REL)
EnumValue
+Enum(lto_linker_output) String(nolto-rel) Value(LTO_LINKER_OUTPUT_NOLTOREL)
+
+EnumValue
Enum(lto_linker_output) String(dyn) Value(LTO_LINKER_OUTPUT_DYN)
EnumValue
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index a310d69..1a70f4f 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -879,8 +879,28 @@ lto_post_options (const char **pfilename ATTRIBUTE_UNUSED)
switch (flag_lto_linker_output)
{
case LTO_LINKER_OUTPUT_REL: /* .o: incremental link producing LTO IL */
+ /* Configure compiler same way as normal frontend would do with -flto:
+ this way we read the trees (declarations & types), symbol table,
+ optimization summaries and link them. Subsequently we output new LTO
+ file. */
+ flag_lto = "";
+ flag_incremental_link = INCREMENTAL_LINK_LTO;
flag_whole_program = 0;
- flag_incremental_link = 1;
+ flag_wpa = 0;
+ flag_generate_lto = 1;
+ /* It would be cool to produce .o file directly, but our current
+ simple objects does not contain the lto symbol markers. Go the slow
+ way through the asm file. */
+ lang_hooks.lto.begin_section = lhd_begin_section;
+ lang_hooks.lto.append_data = lhd_append_data;
+ lang_hooks.lto.end_section = lhd_end_section;
+ if (flag_ltrans)
+ error ("-flinker-output=rel and -fltrans are mutually exclussive");
+ break;
+
+ case LTO_LINKER_OUTPUT_NOLTOREL: /* .o: incremental link producing asm */
+ flag_whole_program = 0;
+ flag_incremental_link = INCREMENTAL_LINK_NOLTO;
break;
case LTO_LINKER_OUTPUT_DYN: /* .so: PID library */
@@ -1269,7 +1289,8 @@ lto_init (void)
in_lto_p = true;
/* We need to generate LTO if running in WPA mode. */
- flag_generate_lto = (flag_wpa != NULL);
+ flag_generate_lto = (flag_incremental_link == INCREMENTAL_LINK_LTO
+ || flag_wpa != NULL);
/* Create the basic integer types. */
build_common_tree_nodes (flag_signed_char);
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index d2ccaf6..86f3fe4 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -3257,7 +3257,8 @@ static void
lto_process_name (void)
{
if (flag_lto)
- setproctitle ("lto1-lto");
+ setproctitle (flag_incremental_link == INCREMENTAL_LINK_LTO
+ ? "lto1-inclink" : "lto1-lto");
if (flag_wpa)
setproctitle ("lto1-wpa");
if (flag_ltrans)