From patchwork Sat May 15 18:41:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 1478930 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; 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=rpWmKCVZ; 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 4FjDkt700lz9sWF for ; Sun, 16 May 2021 04:41:41 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DCDEE3857815; Sat, 15 May 2021 18:41:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DCDEE3857815 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1621104096; bh=1/APDaf7ZVWHINH3HKLEZMd+b/vfvSoQDB094ewI9cE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=rpWmKCVZZqNnRN03snIN1eORQq1+lAhmrA4dv7QQHfjhqBYG3dgnb6EE+z0y8LODj dbwowX2qkKc6S09I2UDfb98lHWwB72QtBOaMNS69nnFAI3gDt3+pSXQ7YZWDmVNxGx l5WJNpUQpB+QU6qkp9NBTIqppE3Kc2vipKpnUvMI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by sourceware.org (Postfix) with ESMTPS id 92F18385803D for ; Sat, 15 May 2021 18:41:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 92F18385803D To: Subject: reorg.c (fill_slots_from_thread): Reinstate code typoed out in "Remove CC0". MIME-Version: 1.0 Message-ID: <20210515184132.BF8E5203BE@pchp3.se.axis.com> Date: Sat, 15 May 2021 20:41:32 +0200 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, 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: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson Cc: segher@kernel.crashing.org Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Committed as obvious. The typo here, is obviously mistaken removal of lines next to a line that was validly removed. Targets affected are those with a delay-slot *and* defining TARGET_FLAGS_REGNUM. In-tree, a git-grep says the only ones matching are CRIS, h8300 and visium. The code removal has the effect of wrong-code, not reverting the effect of r11-2814. I'm "guessing" it was the effect of an incorrect conflict resolution in preparatory work for the r12-440 / bd1cd0d0e0fe / "Remove CC0" commit, when rebasing a related branch, and not testing any of the affected targets. Either way, the effect was a btest-gcc.sh state of "regress-1152" for cris-elf. FWIW, I wrote the removed code (sans the validly removed cc0 line), a part of what was committed at 2020-08-24 as 0e6c51de8ec47 / r11-2814. This commit gets cris-elf test-results back to a sane state (tested at 0ffdbc85d9a6 / r12-761). gcc: * reorg.c (fill_slots_from_thread): Reinstate code typoed out in "Remove CC0". --- gcc/reorg.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gcc/reorg.c b/gcc/reorg.c index 4595f9a541f0..7f06a6f6d092 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -2375,6 +2375,16 @@ fill_slots_from_thread (rtx_jump_insn *insn, rtx condition, if (! insn_references_resource_p (trial, &set, true) && ! insn_sets_resource_p (trial, filter_flags ? &fset : &set, true) && ! insn_sets_resource_p (trial, &needed, true) + /* If we're handling sets to the flags register specially, we + only allow an insn into a delay-slot, if it either: + - doesn't set the flags register, + - the "set" of the flags register isn't used (clobbered), + - insns between the delay-slot insn and the trial-insn + as accounted in "set", have not affected the flags register. */ + && (! filter_flags + || ! insn_sets_resource_p (trial, &flags_res, true) + || find_regno_note (trial, REG_UNUSED, targetm.flags_regnum) + || ! TEST_HARD_REG_BIT (set.regs, targetm.flags_regnum)) && ! can_throw_internal (trial)) { rtx_insn *prior_insn;