From patchwork Fri Aug 2 22:12:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 264356 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 "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 6424B2C0289 for ; Sat, 3 Aug 2013 08:13:13 +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 :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=Lw/MZ8D8GuaKYZ4WfYRpknARtiz9uBvVYa26Z/rdgw0Vjl Ig3cDCBMDuy1cpktlsvTNpOKCg9CABO4JWIuxBDGJUhb8/g8LUjzYUB4Ljx3dxdH XKDtGIK0zkSqZeXRxS0us+ESxID/NVBdkS08Ctubwb52/JRaXDBZm/yHaGsCY= 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 :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=LEIBFKU2wCrGnJNL+3dz55o/Gm0=; b=g8wxx7tzIoTXrPJK+S9j wY/O/nST6kpiinKwVfGqO3im0Ku32DYwyvEEbdpxeU6YiaKihS5pGeMjeQm+IbxB gdjcdjiQhPs549EApUGc22N36/Nb2wBYP3U5KBY242qljO+h+PO8xqwSXyOejj3v S2lIEhfvEAfnqWzimVjcJQk= Received: (qmail 20313 invoked by alias); 2 Aug 2013 22:13:07 -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 20300 invoked by uid 89); 2 Aug 2013 22:13:06 -0000 X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=AWL, BAYES_20, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, RDNS_NONE, SPF_HELO_PASS, SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 02 Aug 2013 22:13:06 +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.14.4/8.14.4) with ESMTP id r72MCwwb008036 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 2 Aug 2013 18:12:59 -0400 Received: from Mair.local (vpn-63-101.rdu2.redhat.com [10.10.63.101]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r72MCuQl002145 for ; Fri, 2 Aug 2013 18:12:57 -0400 Message-ID: <51FC2EE8.6010202@redhat.com> Date: Fri, 02 Aug 2013 18:12:56 -0400 From: Vladimir Makarov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: GCC Patches Subject: patch to fix PR58048 X-Virus-Found: No The following patch fixes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58048 LRA has a correct behaviour (as reload) on the test with -O0. But with -O2 a constant propagation into asm operands resulted in LRA cycling instead of error reporting. The patch was successfully bootstrapped and tested on x86/x86-64. Committed as rev. 201454. 2013-08-02 Vladimir Makarov PR rtl-optimization/58048 * lra-constraints.c (process_alt_operands): Don't check asm operand on register. 2013-08-02 Vladimir Makarov PR rtl-optimization/58048 * gcc.target/i386/pr58048.c: New. Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 201438) +++ lra-constraints.c (working copy) @@ -1892,7 +1892,7 @@ process_alt_operands (int only_alternati /* For asms, verify that the class for this alternative is possible for the mode that is specified. */ - if (!no_regs_p && REG_P (op) && INSN_CODE (curr_insn) < 0) + if (!no_regs_p && INSN_CODE (curr_insn) < 0) { int i; for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) Index: testsuite/gcc.target/i386/pr58048.c =================================================================== --- testsuite/gcc.target/i386/pr58048.c (revision 0) +++ testsuite/gcc.target/i386/pr58048.c (working copy) @@ -0,0 +1,11 @@ +/* PR target/58048 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +void +div3 (void) +{ + double tmp1; + + asm volatile ("fscale":"=t" (tmp1):"0" (0), "u" (0)); /* { dg-error "inconsistent operand constraints in an 'asm'" } */ +}