From patchwork Wed Jul 7 07:57:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramana Radhakrishnan X-Patchwork-Id: 58083 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 70891B6EFE for ; Wed, 7 Jul 2010 17:57:17 +1000 (EST) Received: (qmail 22838 invoked by alias); 7 Jul 2010 07:57:15 -0000 Received: (qmail 22830 invoked by uid 22791); 7 Jul 2010 07:57:15 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cam-admin0.cambridge.arm.com (HELO cam-admin0.cambridge.arm.com) (217.140.96.50) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Jul 2010 07:57:09 +0000 Received: from cam-owa1.Emea.Arm.com (cam-owa1.emea.arm.com [10.1.255.62]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id o677v5eI005067; Wed, 7 Jul 2010 08:57:05 +0100 (BST) Received: from [10.1.66.29] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 7 Jul 2010 08:57:05 +0100 Subject: [Patch tree-sra] Fix to set up correct context for call to compute_inline_parameter (PR44768) From: Ramana Radhakrishnan Reply-To: ramana.radhakrishnan@arm.com To: gcc-patches@gcc.gnu.org Cc: mjambor@suse.cz Date: Wed, 07 Jul 2010 08:57:05 +0100 Message-Id: <1278489425.17030.13.camel@e102325-lin.cambridge.arm.com> Mime-Version: 1.0 X-IsSubscribed: yes 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, When the fix for PR12392 went in or specifically this commit (http://gcc.gnu.org/viewcvs?view=revision&revision=152368), the loop in tree-sra.c was split into 2 but the context for the call to compute_inline_parameters wasn't moved as a part of the loop split. This led to a latent bug being introduced which after the recent fix to PR43905 caused it to manifest itself as PR44768 on arm-linux-gnueabi. C only bootstrap completed successfully. A full bootstrap and test run is on currently with trunk. I believe this problem is latent on the gcc 4.5 branch and probably needs fixing there as well but I don't have a testcase that exposes this specific problem on 4.5 branch. Ok to commit to trunk and 4.5 branch after regression testing ? cheers Ramana Index: gcc/tree-sra.c =================================================================== --- gcc/tree-sra.c (revision 161899) +++ gcc/tree-sra.c (working copy) @@ -4209,8 +4209,11 @@ convert_callers (struct cgraph_node *nod for (cs = node->callers; cs; cs = cs->next_caller) if (!bitmap_bit_p (recomputed_callers, cs->caller->uid)) { + current_function_decl = cs->caller->decl; + push_cfun (DECL_STRUCT_FUNCTION (cs->caller->decl)); compute_inline_parameters (cs->caller); bitmap_set_bit (recomputed_callers, cs->caller->uid); + pop_cfun (); } BITMAP_FREE (recomputed_callers);