public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Hans-Peter Nilsson <hp@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-810] reorg.c (fill_slots_from_thread): Reinstate code typoed out in "Remove CC0".
Date: Sat, 15 May 2021 18:35:21 +0000 (GMT)	[thread overview]
Message-ID: <20210515183521.071F2385803D@sourceware.org> (raw)

https://gcc.gnu.org/g:57d2342fbb55f73ef29ca186744663b320352c92

commit r12-810-g57d2342fbb55f73ef29ca186744663b320352c92
Author: Hans-Peter Nilsson <hp@axis.com>
Date:   Sat May 15 01:26:17 2021 +0200

    reorg.c (fill_slots_from_thread): Reinstate code typoed out in "Remove CC0".
    
    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".

Diff:
---
 gcc/reorg.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gcc/reorg.c b/gcc/reorg.c
index 4595f9a541f..7f06a6f6d09 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;


                 reply	other threads:[~2021-05-15 18:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210515183521.071F2385803D@sourceware.org \
    --to=hp@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).