From patchwork Wed Dec 29 21:51:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 76950 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 4E7DAB70DF for ; Thu, 30 Dec 2010 08:51:59 +1100 (EST) Received: (qmail 12779 invoked by alias); 29 Dec 2010 21:51:58 -0000 Received: (qmail 12769 invoked by uid 22791); 29 Dec 2010 21:51:57 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, TW_TM, TW_TX, 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, 29 Dec 2010 21:51:53 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oBTLppQ6016291 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 29 Dec 2010 16:51:51 -0500 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oBTLpoqr030996 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 29 Dec 2010 16:51:51 -0500 Received: from tyan-ft48-01.lab.bos.redhat.com (localhost.localdomain [127.0.0.1]) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4) with ESMTP id oBTLpo6i030861 for ; Wed, 29 Dec 2010 22:51:50 +0100 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id oBTLpoqE030860 for gcc-patches@gcc.gnu.org; Wed, 29 Dec 2010 22:51:50 +0100 Date: Wed, 29 Dec 2010 22:51:50 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] Fix gimple-fold.c (PR tree-optimization/47074) Message-ID: <20101229215150.GS16156@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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! gimplify_and_update_call_from_tree was forgetting to call pop_gimplify_context when returning early, keeping gimple_ctxp to point somewhere into stack and causing corruption of whatever happened to be on the stack at that spot afterwards. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk as obvious. 2010-12-29 Jakub Jelinek PR tree-optimization/47074 * gimple-fold.c (gimplify_and_update_call_from_tree): Call pop_gimplify_context if returning early. Jakub --- gcc/gimple-fold.c.jj 2010-12-28 12:33:08.000000000 +0100 +++ gcc/gimple-fold.c 2010-12-29 14:46:14.000000000 +0100 @@ -942,6 +942,7 @@ gimplify_and_update_call_from_tree (gimp which gets optimized away by C++ gimplification. */ if (gimple_seq_empty_p (stmts)) { + pop_gimplify_context (NULL); if (gimple_in_ssa_p (cfun)) { unlink_stmt_vdef (stmt);