rtl-optimization/117611 - ICE in simplify_shift_const_1
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gcc_build--master-arm |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gcc_check--master-arm |
success
|
Test passed
|
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 |
success
|
Test passed
|
Commit Message
The following checks we have a scalar int shift mode before
enforcing it. As AVR shows the mode can be a signed _Accum mode
as well.
Bootstrap and regtest pending on x86_64-unknown-linux-gnu.
OK if that succeeds?
Thanks,
Richard.
PR rtl-optimization/117611
* combine.cc (simplify_shift_const_1): Bail if not
scalar int mode.
* gcc.target/avr/pr117611.c: New testcase.
---
gcc/combine.cc | 6 ++++--
gcc/testsuite/gcc.target/avr/pr117611.c | 7 +++++++
2 files changed, 11 insertions(+), 2 deletions(-)
create mode 100644 gcc/testsuite/gcc.target/avr/pr117611.c
@@ -10635,8 +10635,10 @@ simplify_shift_const_1 (enum rtx_code code, machine_mode result_mode,
outer_op, outer_const);
}
- scalar_int_mode shift_unit_mode
- = as_a <scalar_int_mode> (GET_MODE_INNER (shift_mode));
+ scalar_int_mode shift_unit_mode;
+ if (!is_a <scalar_int_mode> (GET_MODE_INNER (shift_mode),
+ &shift_unit_mode))
+ return NULL_RTX;
/* Handle cases where the count is greater than the size of the mode
minus 1. For ASHIFT, use the size minus one as the count (this can
new file mode 100644
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-Os" } */
+
+_Accum acc1 (_Accum x)
+{
+ return x << 16;
+}