From patchwork Tue Dec 11 09:12:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 205140 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 CBA522C0098 for ; Tue, 11 Dec 2012 20:17:33 +1100 (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=1355822254; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Cc:Subject:Date:Message-ID:User-Agent: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=igBeVne+O4AgGxrR5SCfEli11HI=; b=KZeyh/DWswcnmuj v520o7/hBL88w2GDiwtZTgmC8sTXo+Bm90+F8AwFV9F0DMPD02TOpz2fsMmoSzMA KKeI+W+Jo6lEk2OMfKVNentCBeu8wRcXcQ5+x6FwpYH9xdIu/toXIDuewY0CqoAo GX1JSUvkweTzczkJ+KCBcdBPc88U= 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:Cc:Subject:Date:Message-ID:User-Agent:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=Wh1vz3O8UsDDPuzvNoIktkgFEhQEHbr2fBRXtWmn9lpIg0LYBf5SYk4z4M1rbI nRGfYevlo19Yfvc4Uz29QdDlCC0OkuFtwWvDQLRgozIZtGkppjtIJdzod3Htl2PE lIR6Lcrx0QNT7zXkrtBA3//qom/A3LnVXlxOyt8KreX24=; Received: (qmail 12118 invoked by alias); 11 Dec 2012 09:17:28 -0000 Received: (qmail 12091 invoked by uid 22791); 11 Dec 2012 09:17:26 -0000 X-SWARE-Spam-Status: No, hits=-3.0 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED 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; Tue, 11 Dec 2012 09:17:23 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id C242ECB3DB5; Tue, 11 Dec 2012 10:17:27 +0100 (CET) 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 FwzDYs4Efb5D; Tue, 11 Dec 2012 10:17:27 +0100 (CET) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 88503CB3D95; Tue, 11 Dec 2012 10:17:27 +0100 (CET) From: Eric Botcazou To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: Re: Fix ICE on loop over constant vector at -O Date: Tue, 11 Dec 2012 10:12:50 +0100 Message-ID: <3439897.HpEVehmzsD@polaris> User-Agent: KMail/4.7.2 (Linux/3.1.10-1.16-desktop; KDE/4.7.2; x86_64; ; ) In-Reply-To: References: <1486156.RQZsauqaQ0@polaris> <1432659.TUvqROIShk@polaris> MIME-Version: 1.0 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 > ... so if would really be a pessimization doing that. Of course handling > CONST_DECL in for_each_index is indeed obvious - I just was curios if > it was a missed-optimization opportunity as well. It turns out that, for the same testcase, &CONST_DECL is generated on the MIPS and prepare_decl_rtl is trying to put an RTX on the CONST_DECL, hence ICE. Tested on x86_64-suse-linux, applied on the mainline as obvious. I agree that this is on the fringes of what we have to support, but we won't revisit it until the 4.9 development cycle. 2012-12-11 Eric Botcazou * tree-ssa-loop-ivopts.c (prepare_decl_rtl) : Generate RTL only for a DECL which HAS_RTL_P. Index: tree-ssa-loop-ivopts.c =================================================================== --- tree-ssa-loop-ivopts.c (revision 194382) +++ tree-ssa-loop-ivopts.c (working copy) @@ -2806,7 +2806,7 @@ prepare_decl_rtl (tree *expr_p, int *ws, expr_p = &TREE_OPERAND (*expr_p, 0)) continue; obj = *expr_p; - if (DECL_P (obj) && !DECL_RTL_SET_P (obj)) + if (DECL_P (obj) && HAS_RTL_P (obj) && !DECL_RTL_SET_P (obj)) x = produce_memory_decl_rtl (obj, regno); break;