Sanitize the constant argument for rotr<mode>3
This was dormant for quite some time, but it started happening for me on gcc.c-torture/compile/pr65153.c sometime after r276645 for -mabi=32 linux runs. The pattern accepts any SMALL_OPERAND constant value while it asserts during the final that the value is in the mode size range. I this case it happens that combine_and_move_insns during ira makes a pattern with negative "shift count" which fails at final stage. This simple fix just truncates the constant operand to mode size the same as shift patterns. gcc/ChangeLog: 2019-11-13 Dragan Mladjenovic <dmladjenovic@wavecomp.com> * config/mips/mips.md (rotr<mode>3): Sanitize the constant argument instead of asserting its value. From-SVN: r278152
This commit is contained in:
parent
d51dd316a2
commit
425ea30f79
2 changed files with 7 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
2019-11-13 Dragan Mladjenovic <dmladjenovic@wavecomp.com>
|
||||
|
||||
* config/mips/mips.md (rotr<mode>3): Sanitize the constant argument
|
||||
instead of asserting its value.
|
||||
|
||||
2019-11-13 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* gimple-fold.c (size_must_be_zero_p): Rewrite use of value_range
|
||||
|
|
|
@ -5845,8 +5845,8 @@
|
|||
"ISA_HAS_ROR"
|
||||
{
|
||||
if (CONST_INT_P (operands[2]))
|
||||
gcc_assert (INTVAL (operands[2]) >= 0
|
||||
&& INTVAL (operands[2]) < GET_MODE_BITSIZE (<MODE>mode));
|
||||
operands[2] = GEN_INT (INTVAL (operands[2])
|
||||
& (GET_MODE_BITSIZE (<MODE>mode) - 1));
|
||||
|
||||
return "<d>ror\t%0,%1,%2";
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue