Patchwork For -fno-builtin disable pattern recognition if not enabled explicitly in lto.

login
register
mail settings
Submitter Kito Cheng
Date Aug. 28, 2014, 10:25 a.m.
Message ID <CA+yXCZCaO2RvoE1syJB01t8BfyVJ5QdbtuDRN3Gb4U0jNU1Byw@mail.gmail.com>
Download mbox | patch
Permalink /patch/383754/
State New
Headers show

Comments

Kito Cheng - Aug. 28, 2014, 10:25 a.m.
Hi all:
The purpose for this patch is prevent `-flto -O3 -fno-builtin`  gen
builtin function,
so checking -fno-builit, and then disable
-ftree-loop-distribute-patterns if if -fno-builit enabled, the prev
discuss in [1], and this patch dependence on [2].

[1] https://gcc.gnu.org/ml/gcc-patches/2014-08/msg02483.html
[2] https://gcc.gnu.org/ml/gcc-patches/2014-08/msg02555.html

Patch

From 80922e53ff41b1c08322a0d0ae5b6d947cb39353 Mon Sep 17 00:00:00 2001
From: Kito Cheng <kito.cheng@gmail.com>
Date: Thu, 28 Aug 2014 18:06:48 +0800
Subject: [PATCH 2/2] For -fno-builtin disable pattern recognition if not
 enabled explicitly. 2014-09-28  Kito Cheng  <kito@0xlab.org>

	lto/
	* lto-lang.c (lto_post_options): For -fno-builtin disable
	pattern recognition if not enabled explicitly.
---
 gcc/lto/lto-lang.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index 9e8524a..ae022cc 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -794,6 +794,11 @@  lto_post_options (const char **pfilename ATTRIBUTE_UNUSED)
      support.  */
   flag_excess_precision_cmdline = EXCESS_PRECISION_FAST;
 
+  /* If -fno-builtin then disable pattern recognition.  */
+  if (!global_options_set.x_flag_tree_loop_distribute_patterns
+      && flag_no_builtin)
+    flag_tree_loop_distribute_patterns = 0;
+
   /* Initialize the compiler back end.  */
   return false;
 }
-- 
1.9.3