Hi all:

This patch basically is extension for r210100[1], stream out
non-explicit -fno-tree-loop-distribute-patterns since compile with
`-flto -O3 -fno-builtin` still may gen builtin function call during
LTO phase.

LTO bootstrapped and tested on x86_64-unknown-linux-gnu.

2014-09-27  Kito Cheng  <k...@0xlab.org>

    * lto-opts.c (lto_write_options): Output non-explicit
    -fno-tree-loop-distribute-patterns.
    * lto-wrapper.c (merge_and_complain): Merge
    -fno-tree-loop-distribute-patterns conservatively.
    (run_gcc): Pass through -fno-tree-loop-distribute-patterns.


[1] https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=210100
From a4d8d1218975413eba8a339e72066ef63649b8a6 Mon Sep 17 00:00:00 2001
From: Kito Cheng <k...@andestech.com>
Date: Tue, 26 Aug 2014 16:44:06 +0800
Subject: [PATCH] Steam out non-explicit -fno-tree-loop-distribute-patterns for
 LTO options

2014-09-26  Kito Cheng  <k...@0xlab.org>

	* lto-opts.c (lto_write_options): Output non-explicit
	-fno-tree-loop-distribute-patterns.
	* lto-wrapper.c (merge_and_complain): Merge
	-fno-tree-loop-distribute-patterns conservatively.
	(run_gcc): Pass through -fno-tree-loop-distribute-patterns.
---
 gcc/lto-opts.c    | 4 ++++
 gcc/lto-wrapper.c | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/gcc/lto-opts.c b/gcc/lto-opts.c
index 986fb97..250d734 100644
--- a/gcc/lto-opts.c
+++ b/gcc/lto-opts.c
@@ -127,6 +127,10 @@ lto_write_options (void)
       && !global_options.x_flag_strict_overflow)
     append_to_collect_gcc_options (&temporary_obstack, &first_p,
 			       "-fno-strict-overflow");
+  if (!global_options_set.x_flag_tree_loop_distribute_patterns
+      && !global_options.x_flag_tree_loop_distribute_patterns)
+    append_to_collect_gcc_options (&temporary_obstack, &first_p,
+				   "-fno-tree-loop-distribute-patterns");
 
   /* Output explicitly passed options.  */
   for (i = 1; i < save_decoded_options_count; ++i)
diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c
index 08fd090..242c128 100644
--- a/gcc/lto-wrapper.c
+++ b/gcc/lto-wrapper.c
@@ -247,6 +247,7 @@ merge_and_complain (struct cl_decoded_option **decoded_options,
 
 	case OPT_ftrapv:
 	case OPT_fstrict_overflow:
+	case OPT_ftree_loop_distribute_patterns:
 	case OPT_ffp_contract_:
 	  /* For selected options we can merge conservatively.  */
 	  for (j = 0; j < *decoded_options_count; ++j)
@@ -505,6 +506,7 @@ run_gcc (unsigned argc, char *argv[])
 	case OPT_fwrapv:
 	case OPT_ftrapv:
 	case OPT_fstrict_overflow:
+	case OPT_ftree_loop_distribute_patterns:
 	case OPT_O:
 	case OPT_Ofast:
 	case OPT_Og:
-- 
1.9.3

Reply via email to