https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127498
Bug ID: 127498
Summary: ICE: in expand_shift_1, at expmed.cc:2713
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: kyuwoncho18 at gmail dot com
Target Milestone: ---
### Reproducer
typedef unsigned char v32qi __attribute__ ((vector_size (32)));
v32qi rot (v32qi x, int n)
{
return (x >> n) | (x << (8 - n));
}
$ gcc -mavx -mgfni repro.c
during RTL pass: expand
<source>: In function 'rot':
<source>:5:19: internal compiler error: in expand_shift_1, at expmed.cc:2713
5 | return (x >> n) | (x << (8 - n));
| ~~~~~~~~~^~~~~~~~~~~~~~~~
0x2067238 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x206052b internal_error(char const*, ...)
???:0
0x7c7a38 fancy_abort(char const*, int, char const*)
???:0
0xa5ef19 expand_variable_shift(tree_code, machine_mode, rtx_def*, tree_node*,
rtx_def*, int)
???:0
0xa73f7c expand_expr_real_2(separate_ops const*, rtx_def*, machine_mode,
expand_modifier)
???:0
0xa7caea expand_expr_real_gassign(gassign*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
???:0
/cefs/38/383ad2f84cbd57a52fd68bbe_consolidated/compilers_c++_x86_gcc_16.1.0/bin/../libexec/gcc/x86_64-linux-gnu/16.1.0/cc1
-quiet -imultiarch x86_64-linux-gnu -iprefix
/cefs/38/383ad2f84cbd57a52fd68bbe_consolidated/compilers_c++_x86_gcc_16.1.0/bin/../lib/gcc/x86_64-linux-gnu/16.1.0/
<source> -quiet -dumpdir /app/ -dumpbase output.c -dumpbase-ext .c -masm=intel
-mavx -mgfni -mtune=generic -march=x86-64 -g -fdiagnostics-color=always
-fno-verbose-asm -o /app/output.s
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1
Only happens with the exact "-mavx -mgfni" at the same time; it does not happen
with a single target.