diff mbox series

Message ID CAMqJFCqsBYuq+FJ2B=zGZ+zB09Bf=oFnonfHXdhFnYCCi7OF7w@mail.gmail.com
State New
Headers show
Series | expand

Commit Message

Joern Rennecke May 16, 2021, 2:25 p.m. UTC
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.

Comments

Richard Sandiford May 27, 2021, 12:11 p.m. UTC | #1
Joern Rennecke <joern.rennecke@embecosm.com> writes:
> 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.

The “Fix match_dup …” should come before the changelog in the commit message.

OK otherwise, thanks.

Richard

> 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;
>
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;