From patchwork Wed Nov 25 17:59:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 548683 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E9B441402A9 for ; Thu, 26 Nov 2015 04:59:24 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=VZsY1VA3; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:message-id:date:mime-version:content-type; q=dns; s= default; b=EbOvKwdTLEkBq2s6NQrO3+q5OL9srQTcn6p57RW04EmsnR6D+3oeR OwDDuGh8aikRPi7Mkq5ryPVoqTSCuveI6dWD3efATQzJBMPGoCwClQD5cByPwK3J cMYyN6kVuroXf/g/+x/Y2o+6P6It5l/XQ9hE8OXij7JEypx7kS06G8= 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:from :subject:to:message-id:date:mime-version:content-type; s= default; bh=q53TI/Y0cwU/tVbc//+aM/o4ZoA=; b=VZsY1VA3+WMwN+hMBxL5 KmwVh0R0sRSt1PQkaHkLjejLVuxUr3TkK7TB3i+aXmi/mEk8mEf+7XVI4skdilrL 9gHPsgTp8GgpIYWv4WXH83AJjVkvVM+chGcIY3m1bNwDgtmv4+XNnSzKXRDS5D4b AHSFkCHkiinpz0CNFpzB9oU= Received: (qmail 47678 invoked by alias); 25 Nov 2015 17:59:17 -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 47665 invoked by uid 89); 25 Nov 2015 17:59:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL, BAYES_00, KAM_ASCII_DIVIDERS, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 25 Nov 2015 17:59:16 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id B89F268E07 for ; Wed, 25 Nov 2015 17:59:14 +0000 (UTC) Received: from [10.3.112.43] (ovpn-112-43.phx2.redhat.com [10.3.112.43]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAPHxDHS014923 for ; Wed, 25 Nov 2015 12:59:14 -0500 From: Vladimir Makarov Subject: patch to fix PR67954 To: gcc-patches Message-ID: <5655F6F1.4020304@redhat.com> Date: Wed, 25 Nov 2015 12:59:13 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 X-IsSubscribed: yes The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67954 The patch was bootstrapped on x86/x86-64. The test is too big and was not included to the patch. Committed as rev. 230893 to gcc-5 branch and as rev. 230894 to trunk. Index: ChangeLog =================================================================== --- ChangeLog (revision 230887) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2015-11-25 Vladimir Makarov + + PR rtl-optimization/67954 + * lra-constraints.c (curr_insn_transform): Add check on scratch + pseudo when change class to NO_REGS. Add an assert. + 2015-11-24 Michael Meissner Backport form mainline Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 230887) +++ lra-constraints.c (working copy) @@ -3738,7 +3738,8 @@ curr_insn_transform (bool check_only_p) assigment pass and the scratch pseudo will be spilled. Spilled scratch pseudos are transformed back to scratches at the LRA end. */ - && lra_former_scratch_operand_p (curr_insn, i)) + && lra_former_scratch_operand_p (curr_insn, i) + && lra_former_scratch_p (REGNO (op))) { int regno = REGNO (op); lra_change_class (regno, NO_REGS, " Change to", true); @@ -3747,6 +3748,8 @@ curr_insn_transform (bool check_only_p) spilled pseudo as there is only one such insn, the current one. */ reg_renumber[regno] = -1; + lra_assert (bitmap_single_bit_set_p + (&lra_reg_info[REGNO (op)].insn_bitmap)); } /* We can do an optional reload. If the pseudo got a hard reg, we might improve the code through inheritance. If