https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80376
Bug ID: 80376 Summary: Some vec_xxpermdi usage lead to ICE Product: gcc Version: 6.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: lu_zero at gentoo dot org Target Milestone: --- Testcase: #include <altivec.h> #include <stdio.h> int main(void) { vector unsigned int a = { 1, 2, 3, 4 }; vector unsigned int b = { -1, -2, -3, -4 }; unsigned int c[4], i, j; for (j = 0; j < 4; j++) { printf("%d -> ", j); vec_vsx_st(vec_xxpermdi(a, b, j), 0, c); for (i = 0; i < 4; i++) { printf("%d ", c[i]); } printf("\n"); } return 0; } compiler log: /tmp/t.c: In function ‘main’: /tmp/t.c:12:5: internal compiler error: in copy_to_mode_reg, at explow.c:601 vec_vsx_st(vec_xxpermdi(a, b, j), 0, c); ^~~~~~~~~~ 0x103b737f copy_to_mode_reg(machine_mode, rtx_def*) ../../src/gcc/explow.c:601 0x10a0ae0f rs6000_expand_ternop_builtin ../../src/gcc/config/rs6000/rs6000.c:14234 0x10a0ae0f rs6000_expand_builtin ../../src/gcc/config/rs6000/rs6000.c:15658 0x1028cf9f expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int) ../../src/gcc/builtins.c:5624 0x103d12ff expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) ../../src/gcc/expr.c:10598 0x103dc017 store_expr_with_bounds(tree_node*, rtx_def*, int, bool, bool, tree_node*) ../../src/gcc/expr.c:5406 0x103dd3cb expand_assignment(tree_node*, tree_node*, bool) ../../src/gcc/expr.c:5175 0x102aec73 expand_call_stmt ../../src/gcc/cfgexpand.c:2658 0x102aec73 expand_gimple_stmt_1 ../../src/gcc/cfgexpand.c:3548 0x102aec73 expand_gimple_stmt ../../src/gcc/cfgexpand.c:3714 0x102b1937 expand_gimple_basic_block ../../src/gcc/cfgexpand.c:5720 0x102b6f87 execute ../../src/gcc/cfgexpand.c:6335