]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix bogus operand predicate on iq2000
authorJeff Law <jlaw@ventanamicro.com>
Tue, 19 Sep 2023 17:28:53 +0000 (11:28 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Tue, 19 Sep 2023 17:30:31 +0000 (11:30 -0600)
commiteec7c373c2de6d5806537552de5f5b2bd064c43e
tree82531bcd42ad5a1279800033e2006b1d13d1bd76
parent15acabb80f91b12836bcf4ffcb92ea10fe4e8272
Fix bogus operand predicate on iq2000

The iq2000-elf port regressed these tests recently:

> iq2000-sim: gcc.c-torture/execute/20040703-1.c   -O2  (test for excess errors)
> iq2000-sim: gcc.c-torture/execute/20040703-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  (test for excess errors)
> iq2000-sim: gcc.c-torture/execute/20040703-1.c   -O3 -g  (test for excess errors)

It turns out one of the patterns had an operand predicate that allowed REG,
SUBREG, CONST_INT (with a limited set of CONST_INTs).  Yet the constraint only
allowed the limited set of immediates.  This naturally triggered an LRA
constraint failure.

The fix is trivial, create an operand predicate that accurately reflects the
kinds of operands allowed by the instruction.

It turns out this was a long standing bug -- fixing the pattern resolved 55
failing tests in the testsuite.

gcc/
* config/iq2000/predicates.md (uns_arith_constant): New predicate.
* config/iq2000/iq2000.md (rotrsi3): Use it.
gcc/config/iq2000/iq2000.md
gcc/config/iq2000/predicates.md