https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89424
Bug ID: 89424 Summary: __builtin_vec_ext_v1ti (v, i) results in ICE with variable i (RS6000) Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: kelvin at gcc dot gnu.org Target Milestone: --- Target: rs6000 Build: 9.0.1 Created attachment 45781 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45781&action=edit preprocessed source code for reproducer The __builtin_vec_ext_v1ti (v, i) function should work with both constant and variable values of int i. With current trunk $GCC_BUILD/GCC/xgcc -B$gcc_build/GCC/ -maltivec -mvsx -O1 -o problem.exe problem.c ends with an internal cmopiler error: during RTL pass: expand prXXXXX-0.c: In function ‘ei’: prXXXXX-0.c:25:10: internal compiler error: in rs6000_expand_vector_extract, at config/rs6000/rs6000.c:6970 25 | return __builtin_vec_ext_v1ti (v, i); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 0x10faeabf rs6000_expand_vector_extract(rtx_def*, rtx_def*, rtx_def*) /home/kelvin/gcc-root/gcc-trunk2/gcc/config/rs6000/rs6000.c:6970 0x10feeeaf altivec_expand_vec_ext_builtin /home/kelvin/gcc-root/gcc-trunk2/gcc/config/rs6000/rs6000.c:14736 0x10feeeaf altivec_expand_builtin /home/kelvin/gcc-root/gcc-trunk2/gcc/config/rs6000/rs6000.c:14969 0x10ff1def rs6000_expand_builtin /home/kelvin/gcc-root/gcc-trunk2/gcc/config/rs6000/rs6000.c:16530 0x1034702b expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int) /home/kelvin/gcc-root/gcc-trunk2/gcc/builtins.c:7226 0x10557feb expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) /home/kelvin/gcc-root/gcc-trunk2/gcc/expr.c:11025 0x1056d8f3 store_expr(tree_node*, rtx_def*, int, bool, bool) /home/kelvin/gcc-root/gcc-trunk2/gcc/expr.c:5669 0x10571463 expand_assignment(tree_node*, tree_node*, bool) /home/kelvin/gcc-root/gcc-trunk2/gcc/expr.c:5432 0x10571463 expand_assignment(tree_node*, tree_node*, bool) /home/kelvin/gcc-root/gcc-trunk2/gcc/expr.c:4978 0x1038082b expand_call_stmt /home/kelvin/gcc-root/gcc-trunk2/gcc/cfgexpand.c:2722 0x1038082b expand_gimple_stmt_1 /home/kelvin/gcc-root/gcc-trunk2/gcc/cfgexpand.c:3691 0x1038082b expand_gimple_stmt /home/kelvin/gcc-root/gcc-trunk2/gcc/cfgexpand.c:3850 0x1038959f expand_gimple_basic_block /home/kelvin/gcc-root/gcc-trunk2/gcc/cfgexpand.c:5886 0x1038be27 execute /home/kelvin/gcc-root/gcc-trunk2/gcc/cfgexpand.c:6509 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. Makefile:26: recipe for target 'prXXXXX-0.exe' failed make: *** [prXXXXX-0.exe] Error 1 kelvin@genoa:~/gcc-root/tests$