From patchwork Thu Aug 28 10:25:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kito Cheng X-Patchwork-Id: 383754 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 63D5214010B for ; Thu, 28 Aug 2014 20:26:09 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=Jx6F22r1uPDlM4Cerbw1dXx8T/XBF6TDxUHXmBTEjV3zl3 WWpQMQKZaKpJRzXJsnLgoUcjPWfkC83Umv+70tPTcD+5XrNATJ3C6BZYgBGF8lqc p8qmWRgg0NIT6WvtIftIMZKPzhVK9fL4RlWzJTBJpOq7kGPB8NSFjqhEELB+o= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=X3h9g2+U9DMfe6xdDHP72WzNask=; b=onE7EZ08Y6a27URmTcfW 173vDdZLT1vdQ4HVyzQIsEEXnkKL3fqSG/pzqA9NkbXWoK2gX0cFKGv9s0UyWq84 fzHZFUmQ3B1rHniw73+xsb3CJ/vdOJCz/u8We60qnAIG1JZIiS05N4El+Z/DGoHo k/OAr97Ost5AKR4PG30KNM8= Received: (qmail 12174 invoked by alias); 28 Aug 2014 10:26:01 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 12157 invoked by uid 89); 28 Aug 2014 10:25:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ie0-f175.google.com Received: from mail-ie0-f175.google.com (HELO mail-ie0-f175.google.com) (209.85.223.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 28 Aug 2014 10:25:56 +0000 Received: by mail-ie0-f175.google.com with SMTP id y20so686137ier.20 for ; Thu, 28 Aug 2014 03:25:55 -0700 (PDT) X-Received: by 10.50.79.201 with SMTP id l9mr36248182igx.17.1409221554999; Thu, 28 Aug 2014 03:25:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.15.161 with HTTP; Thu, 28 Aug 2014 03:25:34 -0700 (PDT) From: Kito Cheng Date: Thu, 28 Aug 2014 18:25:34 +0800 Message-ID: Subject: [PATCH] For -fno-builtin disable pattern recognition if not enabled explicitly in lto. To: Richard Biener , "gcc-patches@gcc.gnu.org" X-IsSubscribed: yes 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 From 80922e53ff41b1c08322a0d0ae5b6d947cb39353 Mon Sep 17 00:00:00 2001 From: Kito Cheng 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 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