http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58383
Bug ID: 58383 Summary: ICE when RTL folds vector operations using constants after gne_int_mode changes Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: jgreenhalgh at gcc dot gnu.org The patch set around [1/4] Using gen_int_mode instead of GEN_INT causes a number of similair regressions when building for AArch64. To pick one example, when building gcc.target/aarch64/vect-fcm-eq-d.c we can get in to the situation where simplify_unary_expression_1 is trying to simplify (V2DI: NOT (NEG X)) and will thus try to generate (V2DI: PLUS (X - 1)). Now we will call plus_constant, and from there gen_int_mode (-1, v2di). From here we call trunc_int_for_mode (-1, v2di) and trigger the assert: /* You want to truncate to a _what_? */ gcc_assert (SCALAR_INT_MODE_P (mode)); The failures eventually look like: In file included from ../src/gcc/gcc/testsuite/gcc.target/aarch64/vect-fcm-eq-d.c:9:0: ../src/gcc/gcc/testsuite/gcc.target/aarch64/vect-fcm.x: In function 'foo': ../src/gcc/gcc/testsuite/gcc.target/aarch64/vect-fcm.x:25:1: internal compiler error: in trunc_int_for_mode, at explow.c:55 } ^ 0x6abc8e trunc_int_for_mode(long, machine_mode) /work/gcc-dev/src/gcc/gcc/explow.c:55 0x69bb28 gen_int_mode(long, machine_mode) /work/gcc-dev/src/gcc/gcc/emit-rtl.c:420 0x6abcf2 plus_constant /work/gcc-dev/src/gcc/gcc/explow.c:189 0x6abcf2 plus_constant /work/gcc-dev/src/gcc/gcc/explow.c:79 0x8f107f simplify_gen_unary(rtx_code, machine_mode, rtx_def*, machine_mode) /work/gcc-dev/src/gcc/gcc/simplify-rtx.c:369 0xc55e09 propagate_rtx_1 /work/gcc-dev/src/gcc/gcc/fwprop.c:490 0xc55e6f propagate_rtx_1 /work/gcc-dev/src/gcc/gcc/fwprop.c:497 0xc55e86 propagate_rtx_1 /work/gcc-dev/src/gcc/gcc/fwprop.c:498 0xc56409 propagate_rtx /work/gcc-dev/src/gcc/gcc/fwprop.c:675 0xc57dff forward_propagate_and_simplify /work/gcc-dev/src/gcc/gcc/fwprop.c:1337 0xc57dff forward_propagate_into /work/gcc-dev/src/gcc/gcc/fwprop.c:1394 0xc58593 forward_propagate_into /work/gcc-dev/src/gcc/gcc/fwprop.c:1359 0xc58593 fwprop /work/gcc-dev/src/gcc/gcc/fwprop.c:1479 0xc58593 execute /work/gcc-dev/src/gcc/gcc/fwprop.c:1515 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions.