From patchwork Wed Sep 8 20:11:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 64202 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 9CA4AB71B3 for ; Thu, 9 Sep 2010 06:12:02 +1000 (EST) Received: (qmail 23039 invoked by alias); 8 Sep 2010 20:11:59 -0000 Received: (qmail 23025 invoked by uid 22791); 8 Sep 2010 20:11:57 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, TW_GJ, TW_TJ, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 08 Sep 2010 20:11:52 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o88KBoK7003348 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 8 Sep 2010 16:11:50 -0400 Received: from toll.yyz.redhat.com (toll.yyz.redhat.com [10.15.16.165]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o88KBnHW006512; Wed, 8 Sep 2010 16:11:50 -0400 Message-ID: <4C87EE05.2060307@redhat.com> Date: Wed, 08 Sep 2010 16:11:49 -0400 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100720 Fedora/3.1.1-1.fc13 Thunderbird/3.1.1 MIME-Version: 1.0 To: gcc-patches CC: Jeffrey Law Subject: [patch] A fix for PR44554 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 The following patch fixes PR40386. The problem in details is described on http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44554. Is it ok to commit into trunk, gcc4.4 and gcc 4.5 branches? 2010-09-08 Vladimir Makarov PR middle-end/44554 * ira.c (ira): Switch off sharing spill slots if setjmp is called. Index: ira.c =================================================================== --- ira.c (revision 164011) +++ ira.c (working copy) @@ -3179,9 +3178,12 @@ ira (FILE *f) ira_assert (ira_conflicts_p || !loops_p); saved_flag_ira_share_spill_slots = flag_ira_share_spill_slots; - if (too_high_register_pressure_p ()) + if (too_high_register_pressure_p () || cfun->calls_setjmp) /* It is just wasting compiler's time to pack spilled pseudos into - stack slots in this case -- prohibit it. */ + stack slots in this case -- prohibit it. We also do this if + there is setjmp call because a variable not modified between + setjmp and longjmp the compiler is required to preserve its + value and sharing slots does not guarantee it. */ flag_ira_share_spill_slots = FALSE; ira_color ();