diff mbox series

RFA: Fix match_dup numbering bug in define_cond_exec

Message ID CAMqJFCpZVitya3SDtT5=6=ut01zPBZkazF+c89SZ9c=BCwVehg@mail.gmail.com
State New
Headers show
Series RFA: Fix match_dup numbering bug in define_cond_exec | expand

Commit Message

Joern Rennecke May 16, 2021, 2:33 p.m. UTC
(Sorry about re-sending - I accidentally forgot to add a subject in
the last post, which would make it hard to have a meaningful thread.)

At the moment, for a match_dup in a define_cond_exec, you'd have to
give the number in the
resulting pattern(s) rather than in the substitute pattern.  That's
not only wrong, but can also
be impossible when the pattern should apply to multiple patterns with
different operand numbers.

The attached patch fixes this.

Bootstrapped on x86_64-pc-linux-gnu.
2020-12-12  Joern Rennecke  <joern.rennecke@embecosm.com>

	Fix match_dup bug of define_cond_exec.
	* gensupport.c (alter_predicate_for_insn): Handle MATCH_DUP.
diff mbox series

Patch

diff --git a/gcc/gensupport.c b/gcc/gensupport.c
index e1ca06dbc1e..92275358078 100644
--- a/gcc/gensupport.c
+++ b/gcc/gensupport.c
@@ -1230,6 +1230,7 @@  alter_predicate_for_insn (rtx pattern, int alt, int max_op,
     case MATCH_OPERATOR:
     case MATCH_SCRATCH:
     case MATCH_PARALLEL:
+    case MATCH_DUP:
       XINT (pattern, 0) += max_op;
       break;