From patchwork Mon Jan 18 21:48:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 1428318 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; 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=iuP98Xhz; 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 4DKQQv5CgPz9sT6 for ; Tue, 19 Jan 2021 08:48:55 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A2E29398D03F; Mon, 18 Jan 2021 21:48:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A2E29398D03F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1611006532; bh=ltxsr4A64rudQS9QTAyV9rmeTiBHxp8h2W/Q8vgl/q8=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=iuP98Xhz1T9fEf73yGq3gQodZZIAM77Uxr9BQNyImIPz6cNJ33bzAmxvxZnf3xKNT HwpipIAF9WfbFQIPcbxohfPfClYX0lgrdOKdWxPMcbSyBkJGRNIUnoMeU044zj8+GD J5iB8f7HqoX8ulS9qDlJd4Qh1+xihxStpgG6aYVw= 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 21980398D032 for ; Mon, 18 Jan 2021 21:48:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 21980398D032 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-596-7G7XcduVM1OU2mX6g4Ptqg-1; Mon, 18 Jan 2021 16:48:47 -0500 X-MC-Unique: 7G7XcduVM1OU2mX6g4Ptqg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4F4E7107ACE4 for ; Mon, 18 Jan 2021 21:48:46 +0000 (UTC) Received: from [10.10.112.156] (ovpn-112-156.rdu2.redhat.com [10.10.112.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id 06C2E10013BD for ; Mon, 18 Jan 2021 21:48:45 +0000 (UTC) To: "gcc-patches@gcc.gnu.org" Subject: [committed] IRA: patch to fix PR97847 Message-ID: Date: Mon, 18 Jan 2021 16:48:40 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-Spam-Status: No, score=-13.5 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_LOW, 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=97847 The patch was successfully bootstrapped and tested on x86-64 and ppc64. [PR97847] IRA: Skip abnormal critical edge splitting PPC64 can generate jumps with clobbered pseudo-regs and a BB with such jump can have abnormal output edges. IRA hits an assert when trying to split abnormal critical edge to deal with asm goto output reloads later. The patch just skips splitting abnormal edges. It is assumed that asm-goto with output reloads can not be in BB with output abnormal edges. gcc/ChangeLog: PR target/97847 * ira.c (ira): Skip abnormal critical edge splitting. diff --git a/gcc/ira.c b/gcc/ira.c index 725b0ff0276..f0bdbc8cf56 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -5433,12 +5433,22 @@ ira (FILE *f) for (int i = 0; i < recog_data.n_operands; i++) if (recog_data.operand_type[i] != OP_IN) { + bool skip_p = false; + FOR_EACH_EDGE (e, ei, bb->succs) + if (EDGE_CRITICAL_P (e) + && e->dest != EXIT_BLOCK_PTR_FOR_FN (cfun) + && (e->flags & EDGE_ABNORMAL)) + { + skip_p = true; + break; + } + if (skip_p) + break; output_jump_reload_p = true; FOR_EACH_EDGE (e, ei, bb->succs) if (EDGE_CRITICAL_P (e) && e->dest != EXIT_BLOCK_PTR_FOR_FN (cfun)) { - ira_assert (!(e->flags & EDGE_ABNORMAL)); start_sequence (); /* We need to put some no-op insn here. We can not put a note as commit_edges insertion will