]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
CRIS: Don't apply PATTERN to insn before validation (PR 110144)
authorHans-Peter Nilsson <hp@axis.com>
Wed, 28 Jun 2023 01:01:08 +0000 (03:01 +0200)
committerHans-Peter Nilsson <hp@bitrange.com>
Wed, 28 Jun 2023 21:19:10 +0000 (23:19 +0200)
Oops.  The validation was there, but PATTERN was applied
before that.  Noticeable only with rtl-checking (for example
as in the report: "--enable-checking=yes,rtl") as this
statement was only a (one of many) straggling olde-C
declare-and-initialize-at-beginning-of-block thing.

PR target/110144
* config/cris/cris.cc (cris_postdbr_cmpelim): Don't apply PATTERN
to insn before validating it.

gcc/config/cris/cris.cc

index 7fca2af085a7644c038d9dd9e0f0b53800079d81..f04f501326e7f5df7eba2b5fb792a0292baa6622 100644 (file)
@@ -375,7 +375,6 @@ cris_postdbr_cmpelim ()
   for (insn = get_insns (); insn; insn = next)
     {
       rtx_insn *outer_insn = insn;
-      rtx pat = PATTERN (insn);
 
       next = NEXT_INSN (outer_insn);
 
@@ -389,6 +388,7 @@ cris_postdbr_cmpelim ()
 
       if (!NONDEBUG_INSN_P (insn))
        continue;
+      rtx pat = PATTERN (insn);
 
       /* Consider filled delay slots; there might be a comparison there.
         It's only the second insn in a sequence that is interesting.  */