From patchwork Thu Feb 7 17:06:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 218958 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 8CBA72C0092 for ; Fri, 8 Feb 2013 04:16:46 +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=1360862206; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=45G4APm L0JFr0vnjmf4nTRAoVWo=; b=Z/KqaEaz4jfSbEn6qoxdUFkkZh7v5iohdfMMsge ZBIVbiDoey2Q3tr6cNFoyRfWdL7AO27/9/uH5N2SnNs9MXuMHh8AxkZlspKGXrSf Z6DtUjzRJvqopfTWZUqWD0SKdbIM6KdqWempLZLD+t4HjD1ZevnnHzWE/Lr7xBKy ZPhY= 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:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=P8vXAsxFw/Tx+4YuUGwaMJuR5sKew4rbkC5d/w47NcYeRahIO1vTCP9abmyAUk KeYI//H/lL11WkOMiy5lbu690M42sS9FxEEWFlYm0DHFXbL8UhoQ0R0soGEfYYH+ riBAJO3YJHiu60UHckBdAr9K0QYKRYfiatKTLuR8OCXN0=; Received: (qmail 26462 invoked by alias); 7 Feb 2013 17:16:19 -0000 Received: (qmail 26435 invoked by uid 22791); 7 Feb 2013 17:16:17 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, 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; Thu, 07 Feb 2013 17:15:57 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r17HFvbC025736 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 7 Feb 2013 12:15:57 -0500 Received: from toll.usersys.redhat.com (toll.yyz.redhat.com [10.15.16.165]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r17HFuhK010055 for ; Thu, 7 Feb 2013 12:15:56 -0500 Message-ID: <5113DF15.8040009@redhat.com> Date: Thu, 07 Feb 2013 12:06:29 -0500 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: gcc-patches Subject: patch to fix PR56225 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 The following patch fixes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56225 The patch was successfully bootstrapped and tested on x86/x86-64. Committed as rev. 195856. 2013-02-07 Vladimir Makarov PR rtl-optimization/56225 * lra-constraints.c (process_alt_operands): Check that reload hard reg can hold value for strict_low_part. 2013-02-07 Vladimir Makarov PR rtl-optimization/56225 * gcc.target/i386/pr56225.c: New test. Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 195807) +++ lra-constraints.c (working copy) @@ -1895,7 +1895,22 @@ process_alt_operands (int only_alternati ? in_hard_reg_set_p (this_alternative_set, mode, hard_regno[nop]) : in_class_p (op, this_alternative, NULL)))) - losers++; + { + /* Strict_low_part requires reload the register not + the sub-register. In this case we should check + that a final reload hard reg can hold the + value. */ + if (curr_static_id->operand[nop].strict_low + && REG_P (op) + && hard_regno[nop] < 0 + && GET_CODE (*curr_id->operand_loc[nop]) == SUBREG + && ira_class_hard_regs_num[this_alternative] > 0 + && ! HARD_REGNO_MODE_OK (ira_class_hard_regs + [this_alternative][0], + GET_MODE (op))) + goto fail; + losers++; + } if (operand_reg[nop] != NULL_RTX /* Output operands and matched input operands are not inherited. The following conditions do not Index: testsuite/gcc.target/i386/pr56225.c =================================================================== --- testsuite/gcc.target/i386/pr56225.c (revision 0) +++ testsuite/gcc.target/i386/pr56225.c (working copy) @@ -0,0 +1,12 @@ +/* PR target/56225 */ +/* { dg-do compile { target { ia32 } } } */ +/* { dg-options "-O2 -march=pentium3 -mtune=generic" } */ + +void bar (int); + +void +foo (int x, int y) +{ + __attribute__ ((vector_size (8 * sizeof (short)))) short s0 = { x }; + bar ((short) (long) &s0 + y); +}