https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122620
Bug ID: 122620
Summary: LTO ICE while compiling firefox-145.0 with LTO+PGO
Product: gcc
Version: 15.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: lto
Assignee: unassigned at gcc dot gnu.org
Reporter: jakub at gcc dot gnu.org
Target Milestone: ---
We are seeing ICE when building firefox-1.45.0 with LTO+PGO with gcc version
15.2.1 20251022 (Red Hat 15.2.1-3) (GCC)
/usr/bin/g++ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong
-fstrict-flex-arrays=1 -fno-rtti -pthread -fno-sized-deallocation
-fno-aligned-new -ffunction-sections -fdata-sections -fno-math-errno
-fno-exceptions -pipe -fPIC -O2 -g1 -grecord-gcc-switches -pipe
-Wno-complain-wrong-lang -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3
-Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64
-march=x86-64 -mtune=generic -fasynchronous-unwind-tables
-fstack-clash-protection -fcf-protection -mtls-dialect=gnu2
-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fpermissive
-DNSS_PKCS11_3_0_STRICT -O3 -fomit-frame-pointer -funwind-tables -shared
-Wl,-z,defs -Wl,--gc-sections -Wl,-h,libxul.so -o ../../../dist/bin/libxul.so
-Wl,@/builddir/build/BUILD/firefox-145.0-build/firefox-145.0/objdir/toolkit/library/build/libxul_so.list
-flto=32 -flifetime-dse=1 -Wl,-z,relro -Wl,--as-needed
-Wl,-z,pack-relative-relocs -Wl,-z,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld-errors
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1
-Wl,--no-keep-memory -Wl,--reduce-memory-overheads -Wl,--build-id=sha1
-Wl,-z,noexecstack -Wl,-z,text -Wl,-z,relro -Wl,-z,now -Wl,-z,nocopyreloc
-Wl,-z,pack-relative-relocs -fstack-protector-strong
-Wl,-rpath-link,/builddir/build/BUILD/firefox-145.0-build/firefox-145.0/objdir/dist/bin
-fprofile-use ../../../js/src/build/libjs_static.a
../../../build/pure_virtual/libpure_virtual.a
../../../x86_64-unknown-linux-gnu/release/libgkrust.a
../../../dist/bin/libmozsandbox.so ../../../dist/bin/libgkcodecs.so
../../../dist/bin/liblgpllibs.so ../../../dist/bin/libmozsqlite3.so
../../../dist/bin/libmozgtk.so ../../../dist/bin/libmozwayland.so
-Wl,--version-script,libxul.so.symbols -lresolv -ldl -lX11 -lXcomposite
-lXdamage -lXext -lXfixes -lXrandr -lXrender -ldrm -lpipewire-0.3 -lasound
-lgbm -lpthread -lc -lffi -lplds4 -lplc4 -lnspr4 -lz -lm -lssl3 -lsmime3 -lnss3
-lnssutil3 -lfreetype -lfontconfig -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0
-lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0
-lgobject-2.0 -lglib-2.0 -lrt -ljpeg -lwebp -lwebpdemux -levent -lvpx
-lpixman-1 -L/usr/lib64/pkgconfig/../../lib64 -ldbus-1 -lxcb-shm -lX11-xcb
-lxcb -lXcursor -lXi -v -save-temps
...
dump file: ../../../dist/bin/libxul.so.ltrans100.ltrans.109t.ccp2
/builddir/build/BUILD/firefox-145.0-build/firefox-145.0/third_party/libwebrtc/call/call.cc:
In member function 'CreateVideoReceiveStream':
/builddir/build/BUILD/firefox-145.0-build/firefox-145.0/third_party/libwebrtc/call/call.cc:1017:38:
internal compiler error: Segmentation fault
1017 | webrtc::VideoReceiveStreamInterface* Call::CreateVideoReceiveStream(
| ^
0x12915d5 ???
../../gcc/diagnostic-global-context.cc:517
0xc6e5d6 crash_signal
../../gcc/toplev.cc:325
0x14dc987 gimple_code(gimple const*)
../../gcc/gimple.h:1844
0x14dc987 gimple_nop_p(gimple const*)
../../gcc/gimple.h:6943
0x14dc987 get_default_value
../../gcc/tree-ssa-ccp.cc:287
0x1487652 ccp_finalize
../../gcc/tree-ssa-ccp.cc:380
0x146a915 do_ssa_ccp
../../gcc/tree-ssa-ccp.cc:3021
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
The dump shows that SSA_NAME _786 is only used and never set:
grep '_786\|CreateVideoReceiveStream'
libxul.so.ltrans100.ltrans.100t.fixup_cfg3 | sed -n
'/CreateVideoReceiveStream/,$p'
;; Function CreateVideoReceiveStream
(_ZN6webrtc8internal4Call24CreateVideoReceiveStreamENS_27VideoReceiveStreamInterface6ConfigE,
funcdef_no=5045, decl_uid=29621, cgraph_uid=3320, symbol_order=2486) (unlikely
executed)
struct VideoReceiveStreamInterface * CreateVideoReceiveStream (struct Call *
const this, struct Config & configuration)
int _786;
uprofiler_simple_event_marker ("Call::CreateVideoReceiveStream", 77, 66, 0,
0B, 0B, 0B);
trace_event_unique_profileScope1019.data_.name =
"Call::CreateVideoReceiveStream";
D.170183 = _786;
The SSA_NAME _786 is created in:
(gdb) bt
#0 make_ssa_name_fn (fn=0x7ffff2f3fa90, var=0x7ffff781d5e8, stmt=0x0,
version=<optimized out>) at ../../gcc/tree-ssanames.cc:386
#1 0x00000000013d059e in make_ssa_name (var=<optimized out>, stmt=<optimized
out>, var=<optimized out>, stmt=<optimized out>) at
../../gcc/tree-ssanames.h:100
#2 internal_get_tmp_var (val=<optimized out>, pre_p=0x7fffffffd4c0,
post_p=<optimized out>, is_formal=true, allow_ssa=true, not_gimple_reg=false)
at ../../gcc/gimplify.cc:690
#3 0x00000000013a8b40 in get_formal_tmp_var (val=<optimized out>,
pre_p=0x7fffffffd4c0) at ../../gcc/gimplify.cc:732
#4 gimplify_expr (expr_p=<optimized out>, pre_p=<optimized out>,
post_p=0x7fffffffd388, gimple_test_f=<optimized out>, fallback=<optimized out>)
at ../../gcc/gimplify.cc:20590
#5 0x000000000150af58 in gimple_regimplify_operands (stmt=0x7fffe9115108,
gsi_p=0x7fffffffd630) at ../../gcc/gimplify-me.cc:235
#6 0x000000000149dcc0 in copy_bb (id=<optimized out>, bb=0x7fffefd35cc0,
num=..., den=...) at ../../gcc/tree-inline.cc:2131
#7 copy_cfg_body (id=0x7fffffffd8b0, entry_block_map=0x7fffefd68cc0,
exit_block_map=0x7fffefc87b40, new_entry=0x0) at ../../gcc/tree-inline.cc:3126
#8 copy_body(copy_body_data*, basic_block_def*, basic_block_def*,
basic_block_def*) [clone .isra.0] (id=id@entry=0x7fffffffd8b0,
entry_block_map=entry_block_map@entry=0x7fffefd68cc0,
exit_block_map=exit_block_map@entry=0x7fffefc87b40,
new_entry=new_entry@entry=0x0) at ../../gcc/tree-inline.cc:3379
#9 0x000000000146cad4 in expand_call_inline (bb=<optimized out>,
bb@entry=0x7fffefd68cc0, stmt=<optimized out>, id=id@entry=0x7fffffffd8b0,
to_purge=to_purge@entry=0x7fffffffd890)
at ../../gcc/tree-inline.cc:5220
#10 0x000000000146bc17 in gimple_expand_calls_inline (bb=0x7fffefd68cc0,
id=0x7fffffffd8b0, to_purge=0x7fffffffd890) at ../../gcc/tree-inline.cc:5431
#11 optimize_inline_calls (fn=0x7ffff5d73700) at ../../gcc/tree-inline.cc:5621
#12 0x000000000144f4a4 in inline_transform (node=0x7ffff2db8220) at
../../gcc/ipa-inline-transform.cc:808
#13 0x000000000144e1b8 in execute_one_ipa_transform_pass (node=<optimized out>,
ipa_pass=0x28c6020, do_not_collect=<optimized out>) at ../../gcc/passes.cc:2346
#14 execute_all_ipa_transforms (do_not_collect=false) at
../../gcc/passes.cc:2409
#15 0x0000000001386bef in cgraph_node::expand (this=0x7ffff2db8220) at
../../gcc/cgraphunit.cc:1852
#16 0x00000000018e608e in expand_all_functions () at
../../gcc/cgraphunit.cc:2042
#17 symbol_table::compile (this=0x7ffff7806000) at ../../gcc/cgraphunit.cc:2418
#18 0x00000000018d7dbf in lto_main () at ../../gcc/lto/lto.cc:693
#19 0x00000000018d48b2 in compile_file () at ../../gcc/toplev.cc:455
#20 0x00000000018882a4 in do_compile () at ../../gcc/toplev.cc:2211
#21 toplev::main (this=this@entry=0x7fffffffdcbe, argc=<optimized out>,
argv=<optimized out>) at ../../gcc/toplev.cc:2376
#22 0x000000000188748f in main (argc=<optimized out>, argv=<optimized out>) at
../../gcc/main.cc:39
(gdb) p debug_gimple_stmt ((gimple *) 0x7fffe9115108)
# .MEM = VDEF <.MEM>
MEM[(int *)_693 + 100B] ={v} {CLOBBER(eob)};
(that is the stmt which it is trying to regimplify).