From patchwork Wed Jul 18 14:54:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 171703 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 84D852C032F for ; Thu, 19 Jul 2012 00:55:18 +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=1343228118; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:User-Agent:MIME-Version: Content-Type:Message-Id:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=P1PBAxm3tXRZhUYZ/ejWRdXAl9Q=; b=nKLP9Z369nsmOvB UF7MBXODvsmN0jG34bHs1SC+AEC5IL8pRO11F+V7uZ+mQV0xgGBrUht5RfF0TVKJ sE2/zHSE2o5u6T/0nMaGNJ77Y7UICJdwTFQzFXv5GbB4w9HIXCuF/2rQlIPAgdbE 2CYJxFbguXz1J8/bejcn8iJfla8o= 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:User-Agent:MIME-Version:Content-Type:Message-Id:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=OEEu9Qz+/40cNuaKTx24svAotjbN3bSVOrtjPq3OyoU8VI8QJdIu1pUqH639fz G/CBz4pyltknVu+IGIYcXfgIocP4vWziraGOG/1wAXq6CwOCYNUybwsSB/ZIohVR RrYXdAlSM6caCiv+GyTC5wKaohk837bays0QWL3/MLS7o=; Received: (qmail 7309 invoked by alias); 18 Jul 2012 14:55:12 -0000 Received: (qmail 7295 invoked by uid 22791); 18 Jul 2012 14:55:10 -0000 X-SWARE-Spam-Status: No, hits=-2.0 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; Wed, 18 Jul 2012 14:54:57 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 0BE7D29005B for ; Wed, 18 Jul 2012 16:55:02 +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 UdQs4mDqb8Kc for ; Wed, 18 Jul 2012 16:55:01 +0200 (CEST) Received: from hermes.site (ADijon-552-1-101-157.w90-33.abo.wanadoo.fr [90.33.60.157]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id D1D47290006 for ; Wed, 18 Jul 2012 16:55:01 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [patch] Fix ICE during out-of-SSA Date: Wed, 18 Jul 2012 16:54:16 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.34.10-0.6-desktop; KDE/4.4.4; x86_64; ; ) MIME-Version: 1.0 Message-Id: <201207181654.16090.ebotcazou@adacore.com> 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 This is a regression present on mainline and 4.7 branch for targets using SJLJ exceptions by default in Ada (e.g. ARM). The error message is: Unable to coalesce ssa_names 2 and 20 which are marked as MUST COALESCE. b1_2(ab) and b1_20(ab) +===========================GNAT BUG DETECTED==============================+ | 4.8.0 20120716 (experimental) [trunk revision 189525] (x86_64-suse-linux) GCC error:| | SSA corruption | | Error detected around p.adb:4:1 It's the usual case of overlapping live ranges for (ab) SSA names. Tested on x86_64-suse-linux, OK for the mainline and 4.7 branch? 2012-07-18 Eric Botcazou * tree-ssa-forwprop.c (combine_conversions): Punt if the RHS of the defining statement is a SSA name that occurs in abnormal PHIs. 2012-07-18 Eric Botcazou * gnat.dg/aggr20.ad[sb]: New test. * gnat.dg/aggr20_pkg.ads: New helper. Index: tree-ssa-forwprop.c =================================================================== --- tree-ssa-forwprop.c (revision 189525) +++ tree-ssa-forwprop.c (working copy) @@ -2584,6 +2584,11 @@ combine_conversions (gimple_stmt_iterato unsigned int final_prec = TYPE_PRECISION (type); int final_unsignedp = TYPE_UNSIGNED (type); + /* Don't propagate ssa names that occur in abnormal phis. */ + if (TREE_CODE (defop0) == SSA_NAME + && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (defop0)) + return 0; + /* In addition to the cases of two conversions in a row handled below, if we are converting something to its own type via an object of identical or wider precision, neither