From patchwork Wed Apr 2 12:27:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 336331 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 E83EF1400E0 for ; Wed, 2 Apr 2014 23:27:54 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=RfcqSFaJeykwRHjQa0XJzNfek81Z/0O1MsJqFW5StJbFufltcN PpMd/Ghen9rWxNmnYx2HW5B7Uwf0HH6suqJC0fceMLwnOwlwoN0A62fmSDtZOUGk /PXVGq0yjHPaVUxkjxKRYVN6MLX7L41gIp1ygcgWMudNtQ9eolvKPRIfg= 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:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=qQWz1RSF+fyK2KDe1c9Uk8Qzlyk=; b=FOFQmhmajD3SMUOYfOp9 Jz1ECbLUIkywBJsvJ9CJGs7ttd+GO5A3Ddanjgluj1yruqKFsN/rYhOJVWIJ8lUo Tx0DryGd0xomw4oTjZKLRT+kjwhCTaCv8MUEEX46cmxQIFQDRhPJ1sJmpgvMcVlW DdrmpDsFGGsmg9EiWL1Kayk= Received: (qmail 10836 invoked by alias); 2 Apr 2014 12:27:47 -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 10826 invoked by uid 89); 2 Apr 2014 12:27:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Wed, 02 Apr 2014 12:27:46 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 454D1ACDE for ; Wed, 2 Apr 2014 12:27:43 +0000 (UTC) Date: Wed, 2 Apr 2014 14:27:42 +0200 From: Martin Jambor To: GCC Patches Cc: Richard Biener Subject: [PATCH] Disable IPA-SRA for always_inline functions Message-ID: <20140402122742.GA19304@virgil.suse> Mail-Followup-To: GCC Patches , Richard Biener MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Hi, when dealing with a PR yesterday I have noticed that IPA-SRA was modifying an always_inline function which is useless work since the function must then be inlined anyway. Thus I'd like to propose the following simple change disabling it in such cases. Included in a bootstrap and testing on x86_64-linux. OK for trunk now or in the next stsge1? Thanks, Martin 2014-04-01 Martin Jambor * tree-sra.c (ipa_sra_preliminary_function_checks): Skip always_inline functions. Index: src/gcc/tree-sra.c =================================================================== --- src.orig/gcc/tree-sra.c +++ src/gcc/tree-sra.c @@ -4960,6 +4960,15 @@ ipa_sra_preliminary_function_checks (str if (TYPE_ATTRIBUTES (TREE_TYPE (node->decl))) return false; + if (lookup_attribute ("always_inline", + DECL_ATTRIBUTES (node->decl)) != NULL) + { + if (dump_file) + fprintf (dump_file, "Allways inline function will be inlined " + "anyway. \n"); + return false; + } + return true; }