https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71778
Bug ID: 71778 Summary: [6 Regression][ARM] ICE using non-constant argument to Neon intrinsic that requires constant arguments Product: gcc Version: 6.2.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: jgreenhalgh at gcc dot gnu.org Target Milestone: --- Target: arm*-*-* I'm sure we've fixed this one before (I couldn't find the bug by searching, maybe it was on AArch64), but this code: #include "arm_neon.h" int32x4_t shift (int32x4_t a, int b) { return vshrq_n_s32 (a, b); } Causes an ICE on GCC 6 and trunk: $ arm-none-eabi-gcc foo.c -mfloat-abi=hard -mfpu=neon In file included from foo.c:1:0: In function 'vshrq_n_s32', inlined from 'shift' at foo.c:6:12: arm_neon.h:3789:10: error: argument 2 must be a constant immediate return (int32x4_t)__builtin_neon_vshrs_nv4si (__a, __b); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arm_neon.h: In function 'shift': arm_neon.h:3789:10: internal compiler error: in neon_make_constant, at config/arm/arm.c:12772 0xe57873 neon_make_constant(rtx_def*) .../gcc/config/arm/arm.c:12772 0xfe31bb gen_movv4si(rtx_def*, rtx_def*) .../gcc/config/arm/vec-common.md:35 0x7ea71a insn_gen_fn::operator()(rtx_def*, rtx_def*) const .../gcc/recog.h:301 0x7ea71a emit_move_insn_1(rtx_def*, rtx_def*) .../gcc/expr.c:3491 0x7eaebc emit_move_insn(rtx_def*, rtx_def*) .../gcc/expr.c:3586 0x7f1486 store_expr_with_bounds(tree_node*, rtx_def*, int, bool, bool, tree_node*) .../gcc/expr.c:5583 0x7f4943 expand_assignment(tree_node*, tree_node*, bool) .../gcc/expr.c:5175 0x6dcdfd expand_call_stmt .../gcc/cfgexpand.c:2658 0x6dcdfd expand_gimple_stmt_1 .../gcc/cfgexpand.c:3548 0x6dcdfd expand_gimple_stmt .../gcc/cfgexpand.c:3714 0x6dfaf5 expand_gimple_basic_block .../gcc/cfgexpand.c:5720 0x6e3112 execute .../gcc/cfgexpand.c:6335