From patchwork Thu Nov 26 01:00:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 1406354 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=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (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=PMDWKsYN; dkim-atps=neutral Received: from sourceware.org (unknown [8.43.85.97]) (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 4ChKFZ11f8z9sRK for ; Thu, 26 Nov 2020 12:01:03 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6EA65384243C; Thu, 26 Nov 2020 01:01:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6EA65384243C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1606352460; bh=8vwATkPzus4ugcbED2JbUDs5LL+CxERFMq/qSUQRnpo=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=PMDWKsYNCawReCcT86Sd2TaZdUFZJPSJP0wKyyrZQ/GW2ag9tkd4i/yP7NmTu+qnk /gRQD4adA5G4ZZ3/flZdOKR2FtOZ65QnIFWRTkKlqCr/4dQrXLY1v+GEcrKa3Wo/At k9kHzGb7Fqboy2nAtzM7x74Rxl50G3L9qkzAdF3A= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 347833857C4F for ; Thu, 26 Nov 2020 01:00:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 347833857C4F 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-586-GDDDp-CdMZyokD8v9jSQ6Q-1; Wed, 25 Nov 2020 20:00:53 -0500 X-MC-Unique: GDDDp-CdMZyokD8v9jSQ6Q-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 36CF680623C for ; Thu, 26 Nov 2020 01:00:52 +0000 (UTC) Received: from [10.10.114.169] (ovpn-114-169.rdu2.redhat.com [10.10.114.169]) by smtp.corp.redhat.com (Postfix) with ESMTP id DEC7A5C1BD for ; Thu, 26 Nov 2020 01:00:51 +0000 (UTC) To: "gcc-patches@gcc.gnu.org" Subject: [committed] patch fixing PR97983 Message-ID: <03d3ff2f-9afc-b44d-b14c-f4ce8e44f720@redhat.com> Date: Wed, 25 Nov 2020 20:00:51 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, 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_H4, RCVD_IN_MSPIKE_WL, 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=97983 The patch was successfully bootstrapped on x86_64 and s390x (with --enable-languages=c,c++ --enable-checking=release --disable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-\ id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-gnu-indirect-function --with-long-double-128 --with-arch=zEC12 --with-tune=z13 --enable-decimal-float) commit 0ea3f28e49b1c936fae2b8a5a418440635c6b13a (HEAD -> master) Author: Vladimir N. Makarov Date: Wed Nov 25 17:06:13 2020 -0500 [PR97983] LRA: Use the right emit func for putting insn in the destination BB. gcc/ 2020-11-25 Vladimir Makarov PR bootstrap/97983 * lra.c (lra_process_new_insns): Use emit_insn_before_noloc or emit_insn_after_noloc with the destination BB. diff --git a/gcc/lra.c b/gcc/lra.c index 4ec0f466376..a79213e32e0 100644 --- a/gcc/lra.c +++ b/gcc/lra.c @@ -1908,13 +1908,9 @@ lra_process_new_insns (rtx_insn *insn, rtx_insn *before, rtx_insn *after, tmp = NEXT_INSN (tmp); if (NOTE_INSN_BASIC_BLOCK_P (tmp)) tmp = NEXT_INSN (tmp); - for (curr = tmp; curr != NULL; curr = NEXT_INSN (curr)) - if (INSN_P (curr)) - break; /* Do not put reload insns if it is the last BB - without actual insns. In this case the reload insns - can get null BB after emitting. */ - if (curr == NULL) + without actual insns. */ + if (tmp == NULL) continue; start_sequence (); for (curr = after; curr != NULL_RTX; curr = NEXT_INSN (curr)) @@ -1927,7 +1923,11 @@ lra_process_new_insns (rtx_insn *insn, rtx_insn *before, rtx_insn *after, e->dest->index); dump_rtl_slim (lra_dump_file, copy, NULL, -1, 0); } - emit_insn_before (copy, tmp); + /* Use the right emit func for setting up BB_END/BB_HEAD: */ + if (BB_END (e->dest) == PREV_INSN (tmp)) + emit_insn_after_noloc (copy, PREV_INSN (tmp), e->dest); + else + emit_insn_before_noloc (copy, tmp, e->dest); push_insns (last, PREV_INSN (copy)); setup_sp_offset (copy, last); /* We can ignore BB live info here as it and reg notes