From patchwork Thu Jun 4 16:13:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 1303628 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=bKvBgLtk; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49d9nz1mMmz9sRR for ; Fri, 5 Jun 2020 02:14:13 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D1A423840C04; Thu, 4 Jun 2020 16:14:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D1A423840C04 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591287247; bh=8l0He9O2OBFhfFM3FNcQALf6oP4bIpI67kacS1LzDaw=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=bKvBgLtk0zqIrKR4vLVmp0UYFr6uJcrGbMOFTJC4wM2VNGDx0mmnV+sj3pZtzj7bu sbu2qhlXneEaiKQtuHczPJ8wCewx/NkRE6QBwWftBiIkecc5fcwwIb/3XWQZs3odWJ qL8hAFIOGLTTvzwpjSIW1xsfc58h+0ZxImLgqAbk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by sourceware.org (Postfix) with ESMTP id 0E388386F477 for ; Thu, 4 Jun 2020 16:14:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0E388386F477 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-8-nn1o_twFMn2Goa8xsJOU6A-1; Thu, 04 Jun 2020 12:13:56 -0400 X-MC-Unique: nn1o_twFMn2Goa8xsJOU6A-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E637318FE863 for ; Thu, 4 Jun 2020 16:13:55 +0000 (UTC) Received: from [10.10.119.137] (ovpn-119-137.rdu2.redhat.com [10.10.119.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6A235D9CD for ; Thu, 4 Jun 2020 16:13:54 +0000 (UTC) To: "gcc-patches@gcc.gnu.org" Subject: [COMMITTED] patch for PR95464 Message-ID: Date: Thu, 4 Jun 2020 12:13:51 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-15.7 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Vladimir Makarov via Gcc-patches From: Vladimir Makarov Reply-To: Vladimir Makarov Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" The following patch fixes            https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95464 The patch was successfully bootstrapped and tested on x86-64.  I did not test it on other major targets as they do not deal with STRICT_LOW_PART. There is also no test case for this PR as it is hard to check the right code generation. Add processing STRICT_LOW_PART for matched reloads. 2020-06-04 Vladimir Makarov PR middle-end/95464 * lra.c (lra_emit_move): Add processing STRICT_LOW_PART. * lra-constraints.c (match_reload): Use STRICT_LOW_PART in output reload if the original insn has it too. diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index bf6d4a2fd4b..421c453997b 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -1071,6 +1071,8 @@ match_reload (signed char out, signed char *ins, signed char *outs, if (find_reg_note (curr_insn, REG_UNUSED, out_rtx) == NULL_RTX) { start_sequence (); + if (out >= 0 && curr_static_id->operand[out].strict_low) + out_rtx = gen_rtx_STRICT_LOW_PART (VOIDmode, out_rtx); lra_emit_move (out_rtx, copy_rtx (new_out_reg)); emit_insn (*after); *after = get_insns (); diff --git a/gcc/lra.c b/gcc/lra.c index 3435cff6a1d..caa09d86ca6 100644 --- a/gcc/lra.c +++ b/gcc/lra.c @@ -490,13 +490,16 @@ void lra_emit_move (rtx x, rtx y) { int old; - + rtx_insn *insn; + if (GET_CODE (y) != PLUS) { if (rtx_equal_p (x, y)) return; old = max_reg_num (); - rtx_insn *insn = emit_move_insn (x, y); + + insn = (GET_CODE (x) != STRICT_LOW_PART + ? emit_move_insn (x, y) : emit_insn (gen_rtx_SET (x, y))); /* The move pattern may require scratch registers, so convert them into real registers now. */ if (insn != NULL_RTX)