From patchwork Mon Oct 29 16:06:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 195066 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 AFD812C007C for ; Tue, 30 Oct 2012 03:06:41 +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=1352131604; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Content-Transfer-Encoding:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=+xClx9IeTUXmPu6dZ0hTD04131w=; b=Xa+2pDnhYKqfVDH 15hX1VE91xACNxJwOA1iDBKSCw7nV2bu4fP2V/KQ1125M5g+ZSwwmePg1vLX1Kte 9vCTi7x/ASK8Gq0cNh1qSMHGSKXhAUP+FYDI82eq3dsyEt/CucW0UT2tmQxbyxvj PfvwIWAoHcJJrAtt0E+eLpdE6tq8= 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:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=IRwZB7RrHTc26Yf8hsNAXsJsLQxyMWGtRinG9a3ClReHh6ieAVfEACoAE7nuMA p1Bc5UB02AVWr09b2wy3f+j4meWIwcjM0YxjJuKPdTOq8t+KY6I57AOoI86pAyAl zQDGe2jYg6hpZKelyp9jnvBO2vlTME2+1GvmAEkW6OvXE=; Received: (qmail 7892 invoked by alias); 29 Oct 2012 16:06:35 -0000 Received: (qmail 7860 invoked by uid 22791); 29 Oct 2012 16:06:28 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS 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; Mon, 29 Oct 2012 16:06:18 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9TG6Ha8012657 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 29 Oct 2012 12:06:18 -0400 Received: from Mair.local (vpn-11-173.rdu.redhat.com [10.11.11.173]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q9TG6GBw012565; Mon, 29 Oct 2012 12:06:17 -0400 Message-ID: <508EA978.9060606@redhat.com> Date: Mon, 29 Oct 2012 12:06:16 -0400 From: Vladimir Makarov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: GCC Patches , Richard Sandiford Subject: RFA: patch to fix PR55116 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 H.J. in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55116 reported an interesting address (and:DI (subreg:DI (plus:SI (ashift:SI (reg:SI 96 [ glob_vol_int.22 ]) (const_int 2 [0x2])) (symbol_ref:SI ("glob_vol_int_arr") )) 0) (const_int 4294967295 [0xffffffff])) which can not be correctly extracted. Here `and' with `subreg' behaves as an address mutation. The following patch fixes the problem. Ok to commit, Richard? 2012-10-29 Vladimir Makarov PR middle-end/55116 * rtlanal.c (strip_address_mutation): Add SUBREG case. Index: rtlanal.c =================================================================== --- rtlanal.c (revision 192942) +++ rtlanal.c (working copy) @@ -5459,6 +5459,11 @@ strip_address_mutations (rtx *loc, enum else if (code == AND && CONST_INT_P (XEXP (*loc, 1))) /* (and ... (const_int -X)) is used to align to X bytes. */ loc = &XEXP (*loc, 0); + else if (code == SUBREG + && ! REG_P (XEXP (*loc, 0)) && ! MEM_P (XEXP (*loc, 0))) + /* (subreg (operator ...) ...) usually inside and is used for + mode conversion too. */ + loc = &XEXP (*loc, 0); else return loc; if (outer_code)