From patchwork Mon Sep 24 10:05:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 186357 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]) by ozlabs.org (Postfix) with SMTP id 255D82C0088 for ; Mon, 24 Sep 2012 20:07:36 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1349086058; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version: Content-Type:Content-Transfer-Encoding:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=6RtvqfoTIfSawip89oaN2wQowoE=; b=ywVx2spdphq82vl aHqIqP1kjC0JacL1726PdkU91JsGNznQwQOOfHoCtb2fRAVu51QHauNpkT0AKh6f h8r+zoXPJf8yvajArZ+8XTFyQvBVd8Ub6pUd8m0qn44SG+vSJrrZqLW2qYFc+smh 9PlA8iIkpSjuyqMJ2sl1YWHly0uk= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:Content-Transfer-Encoding:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=S9dl20k+xULhY53C7EU47A175ZY/cei0m85CrPhEfF/G1CsvuX+5WUaDTQEfV1 zBReDF2hWA/civ1QljNVudBU/AaxVUMGACzor7x4ujwn+yB0HND/PkymEdm9JSVI m9h/blbVVEe0JkM9KboaUi/5uOcbU0znA/w50hnRQrMQ4=; Received: (qmail 29407 invoked by alias); 24 Sep 2012 10:07:29 -0000 Received: (qmail 29392 invoked by uid 22791); 24 Sep 2012 10:07:27 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 24 Sep 2012 10:07:13 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 968B229003A for ; Mon, 24 Sep 2012 12:07:23 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SI+khk153UL9 for ; Mon, 24 Sep 2012 12:07:23 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 666A029000D for ; Mon, 24 Sep 2012 12:07:23 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [patch] Stream TYPE_NONALIASED_COMPONENT in LTO mode Date: Mon, 24 Sep 2012 12:05:09 +0200 Message-ID: <3036368.zAi4UHg0cd@polaris> User-Agent: KMail/4.7.2 (Linux/3.1.10-1.16-desktop; KDE/4.7.2; x86_64; ; ) MIME-Version: 1.0 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 Hi, although the type merging machinery deals with TYPE_NONALIASED_COMPONENT, the flag is actually not streamed, which can result in strange performance drops for Ada applications in LTO mode. The attached patch plugs this hole. Tested on x86_64-suse-linux and LTO-bootstrapped. I also checked that the 4.7 compiler can still compile a big Ada application in LTO mode. Can I put this both on mainline and 4.7 branch? This only affects Ada. 2012-09-24 Eric Botcazou * tree-streamer-in.c (unpack_ts_type_common_value_fields): Stream in TYPE_NONALIASED_COMPONENT flag. * tree-streamer-out.c (pack_ts_type_common_value_fields): Stream out TYPE_NONALIASED_COMPONENT flag. Index: tree-streamer-out.c =================================================================== --- tree-streamer-out.c (revision 191365) +++ tree-streamer-out.c (working copy) @@ -279,6 +279,8 @@ pack_ts_type_common_value_fields (struct bp_pack_value (bp, TYPE_NEEDS_CONSTRUCTING (expr), 1); if (RECORD_OR_UNION_TYPE_P (expr)) bp_pack_value (bp, TYPE_TRANSPARENT_AGGR (expr), 1); + else if (TREE_CODE (expr) == ARRAY_TYPE) + bp_pack_value (bp, TYPE_NONALIASED_COMPONENT (expr), 1); bp_pack_value (bp, TYPE_PACKED (expr), 1); bp_pack_value (bp, TYPE_RESTRICT (expr), 1); bp_pack_value (bp, TYPE_CONTAINS_PLACEHOLDER_INTERNAL (expr), 2); Index: tree-streamer-in.c =================================================================== --- tree-streamer-in.c (revision 191365) +++ tree-streamer-in.c (working copy) @@ -335,6 +335,8 @@ unpack_ts_type_common_value_fields (stru TYPE_NEEDS_CONSTRUCTING (expr) = (unsigned) bp_unpack_value (bp, 1); if (RECORD_OR_UNION_TYPE_P (expr)) TYPE_TRANSPARENT_AGGR (expr) = (unsigned) bp_unpack_value (bp, 1); + else if (TREE_CODE (expr) == ARRAY_TYPE) + TYPE_NONALIASED_COMPONENT (expr) = (unsigned) bp_unpack_value (bp, 1); TYPE_PACKED (expr) = (unsigned) bp_unpack_value (bp, 1); TYPE_RESTRICT (expr) = (unsigned) bp_unpack_value (bp, 1); TYPE_CONTAINS_PLACEHOLDER_INTERNAL (expr)