From patchwork Wed Aug 28 09:51:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikael Pettersson X-Patchwork-Id: 270424 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "www.sourceware.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 091EE2C008C for ; Wed, 28 Aug 2013 19:51:26 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:content-type:content-transfer-encoding:message-id :date:from:to:subject; q=dns; s=default; b=xVY3LcDbN0bbxmtWk6Ece uwZ2vfCeo6x89+k61EtJbJ5c/aGOqK2twZ5SpOaUv/l1CZek+2H2fkLjaxj+Gq6t XXl/K+BOFMJT1nRkcjYGkeGIOeU9y2XINer7Rpnw92Y/g5R0TdK6IldvFnlQI5j8 K3Z/Xw4QEDqYcAkpz7szjM= 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 :mime-version:content-type:content-transfer-encoding:message-id :date:from:to:subject; s=default; bh=kX7jR/d/Cv9vmgYJOBMwjCBZt+A =; b=lCN6LaFY3TuO576f62T1xHuKiSwltTXGwSdYAxnoAq/77fGiavCaYl2Ooq4 YygHk1lmKbPKHrv12ZsgqUpSvaOrywwYLvM2MaoMYTTkUIQVylZ0LNt43URd5rbo NQhHip1NRCoiPD3o2iFNdVMPSNT50X47qn1QVyw/vtLA3+d0= Received: (qmail 4438 invoked by alias); 28 Aug 2013 09:51:19 -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 4392 invoked by uid 89); 28 Aug 2013 09:51:19 -0000 Received: from smtp1.uu.se (HELO smtp1.uu.se) (130.238.7.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 28 Aug 2013 09:51:19 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: smtp1.uu.se Received: from pilspetsen.it.uu.se (pilspetsen.it.uu.se [130.238.18.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by bornea.its.uu.se (Postfix) with ESMTPS id 992A338035 for ; Wed, 28 Aug 2013 11:51:05 +0200 (CEST) Received: (from mikpe@localhost) by pilspetsen.it.uu.se (8.14.5+Sun/8.14.5) id r7S9p1FU017833; Wed, 28 Aug 2013 11:51:01 +0200 (MEST) MIME-Version: 1.0 Message-ID: <21021.51205.593292.407246@pilspetsen.it.uu.se> Date: Wed, 28 Aug 2013 11:51:01 +0200 From: Mikael Pettersson To: gcc-patches@gcc.gnu.org Subject: [PATCH 2/2] fix PR48835 ICE-on-HAVE_cc0 regression from PR50780 changes This patch fixes an ICE that occurs in #ifdef HAVE_cc0 code. The ICE breaks Ada bootstrap with m68060 multilibs on m68k-linux; see . The ICE is triggered by the PR middle-end/50780 changes in r180192. Unlike the previous patch for PR49847, there is no simple test case, but a bisection identified the same revision as the trigger. In this case it's the the first in fold_rtx that's reached: it unconditionally returns prev_insn_cc0 but that's NULL in this case (due to r180192 changing the BB boundaries in EH regions), which causes the ICE a few steps later. At this point in fold_rtx, if it cannot optimize the expression it should just return the original expression, so the patch checks if prev_insn_c00 is NULL and if so returns the original expression rather than NULL. Bootstrapped and regtested on m68k-linux, no regressions. This patch has been in a 4.7-based production compiler on m68k-linux since early 2013. Ok for trunk and 4.8? [If approved I'll need help to commit it as I don't have commit rights.] gcc/ 2013-08-28 Mikael Pettersson PR ada/48835 * cse.c (fold_rtx) : If prev_insn_cc0 is NULL return the orginal expression x. --- gcc-4.9-20130818/gcc/cse.c.~1~ 2013-08-05 22:16:05.000000000 +0200 +++ gcc-4.9-20130818/gcc/cse.c 2013-08-24 16:37:47.572940952 +0200 @@ -3137,6 +3137,8 @@ fold_rtx (rtx x, rtx insn) #ifdef HAVE_cc0 case CC0: + if (! prev_insn_cc0) + return x; return prev_insn_cc0; #endif