Bug 2385937

Summary: ICE in extract_insn, at recog.cc:2882
Product: [Fedora] Fedora Reporter: Dan Horák <dan>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 42CC: dmalcolm, fweimer, jakub, jlaw, josmyers, jwakely, mcermak, mpolacek, msebor, nickc, nixuser, sipoyare
Target Milestone: ---   
Target Release: ---   
Hardware: aarch64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 245418    
Attachments:
Description Flags
preprocessed source
none
preprocessed source none

Description Dan Horák 2025-08-01 13:38:51 UTC
When compiling https://github.com/google/highway I am getting an ICE

...
make[2]: Entering directory '/home/sharkcz/projects/highway/build'
[ 93%] Building CXX object CMakeFiles/random_test.dir/hwy/contrib/random/random_test.cc.o
/usr/bin/c++ -DGTEST_LINKED_AS_SHARED_LIBRARY=1 -DHWY_STATIC_DEFINE -I/home/sharkcz/projects/highway -O2 -g -DNDEBUG -std=c++17 -fPIE -fvisibility=hidden -fvisibility-inlines-hidden -Wno-builtin-macro-redefined -D__DATE__=\"redacted\" -D__TIMESTAMP__=\"redacted\" -D__TIME__=\"redacted\" -fmerge-all-constants -Wall -Wextra -Wconversion -Wsign-conversion -Wvla -Wnon-virtual-dtor -Wcast-align -fmath-errno -fno-exceptions -Wno-psabi -DHWY_IS_TEST=1 -MD -MT CMakeFiles/random_test.dir/hwy/contrib/random/random_test.cc.o -MF CMakeFiles/random_test.dir/hwy/contrib/random/random_test.cc.o.d -o CMakeFiles/random_test.dir/hwy/contrib/random/random_test.cc.o -c /home/sharkcz/projects/highway/hwy/contrib/random/random_test.cc
In file included from /home/sharkcz/projects/highway/hwy/contrib/random/random_test.cc:19,
                 from /home/sharkcz/projects/highway/hwy/foreach_target.h:196,
                 from /home/sharkcz/projects/highway/hwy/contrib/random/random_test.cc:17:
/home/sharkcz/projects/highway/hwy/contrib/random/random-inl.h: In constructor ‘hwy::N_SVE::VectorXoshiro::VectorXoshiro(uint64_t, uint64_t)’:
/home/sharkcz/projects/highway/hwy/contrib/random/random-inl.h:199:3: error: unrecognizable insn:
  199 |   }
      |   ^
(insn 37 36 38 2 (set (reg:TI 163 [ D.336200 ])
        (subreg:TI (const_vector:V2DI [
                    (const_int 4 [0x4])
                    (const_poly_int:DI [2, 2])
                ]) 0)) "/home/sharkcz/projects/highway/hwy/contrib/random/random-inl.h":183:9 -1
     (nil))
during RTL pass: vregs
/home/sharkcz/projects/highway/hwy/contrib/random/random-inl.h:199:3: internal compiler error: in extract_insn, at recog.cc:2882
Please submit a full bug report, with preprocessed source.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccYXMOjE.out file, please attach this to your bugreport.
make[2]: *** [CMakeFiles/random_test.dir/build.make:79: CMakeFiles/random_test.dir/hwy/contrib/random/random_test.cc.o] Error 1

This is on Fedora 42 with gcc-15.1.1-2.fc42.aarch64

Reproducible: Always

Comment 1 Dan Horák 2025-08-01 13:39:35 UTC
Created attachment 2102310 [details]
preprocessed source

Comment 2 Dan Horák 2025-08-01 14:28:16 UTC
Created attachment 2102376 [details]
preprocessed source

pruned the source code in random_test.cc

Comment 3 Jakub Jelinek 2025-08-01 14:32:45 UTC
I'm already cvise reducing it, at 7542484 bytes preprocessed now after 26 minutes.

Comment 4 Dan Horák 2025-08-01 14:40:15 UTC
thanks, I usually struggle with cvise :-)

Comment 5 Jakub Jelinek 2025-08-01 17:18:15 UTC
Reduced testcase (-O2):
#pragma GCC aarch64 "arm_sve.h"
#pragma GCC target "+sve2"

struct A { int b[2]; };
struct B { B (A); };
struct C { C () : g { { 0, (int) svcntd_pat (SV_ALL) } } {} B g; };

void
foo ()
{
  C {};
}