Bug 2216258

Summary: ICE in eliminate_stmt, at tree-ssa-sccvn.cc:6870 when compiling Firefox / jpeg-xl
Product: [Fedora] Fedora Reporter: Dan Horák <dan>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 38CC: dmalcolm, fweimer, jakub, jlaw, jwakely, mcermak, mpolacek, msebor, nickc, sipoyare
Target Milestone: ---   
Target Release: ---   
Hardware: aarch64   
OS: Linux   
Whiteboard:
Fixed In Version: gcc-13.2.1-2.fc39.aarch64 gcc-13.2.1-2.fc40.aarch64 gcc-13.2.1-4.fc38 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-10-11 09:47:41 UTC 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

Description Dan Horák 2023-06-20 15:33:45 UTC
17:17.77 /usr/bin/g++ -o color_management.o -c  -I/home/sharkcz/projects/firefox/obj-aarch64-unknown-linux-gnu/dist/stl_wrappers -I/home/sharkcz/projects/firefox/obj-aarch64-unknown-linux-gnu/dist/system_wrappers -include /home/sharkcz/projects/firefox/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -DNDEBUG=1 -DTRIMMED=1 -DJPEGXL_ENABLE_BOXES=0 -DJPEGXL_ENABLE_TRANSCODE_JPEG=0 -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DSTATIC_EXPORTABLE_JS_API -I/home/sharkcz/projects/firefox/media/libjxl -I/home/sharkcz/projects/firefox/obj-aarch64-unknown-linux-gnu/media/libjxl -I/home/sharkcz/projects/firefox/media/libjxl/include -I/home/sharkcz/projects/firefox/third_party/jpeg-xl -I/home/sharkcz/projects/firefox/third_party/jpeg-xl/lib/include -I/home/sharkcz/projects/firefox/obj-aarch64-unknown-linux-gnu/dist/include -I/home/sharkcz/projects/firefox/obj-aarch64-unknown-linux-gnu/dist/include/nspr -I/home/sharkcz/projects/firefox/obj-aarch64-unknown-linux-gnu/dist/include/nss -DMOZILLA_CLIENT -include /home/sharkcz/projects/firefox/obj-aarch64-unknown-linux-gnu/mozilla-config.h -fno-sized-deallocation -fno-aligned-new -fno-exceptions -fPIC -fno-rtti -fno-exceptions -fno-math-errno -pthread -pipe -gdwarf-4 -freorder-blocks -O2 -fno-omit-frame-pointer -funwind-tables -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wno-invalid-offsetof -Wc++2a-compat -Wcomma-subscript -Wvolatile -Wno-error=deprecated -Wno-error=deprecated-enum-enum-conversion -Wduplicated-cond -Wimplicit-fallthrough -Wlogical-op -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wno-multistatement-macros -Wno-error=class-memaccess -Wformat -Wformat-overflow=2 -Wno-psabi -Wno-error=builtin-macro-redefined -fno-strict-aliasing -ffp-contract=off  -MD -MP -MF .deps/color_management.o.pp  -fdiagnostics-color  /home/sharkcz/projects/firefox/third_party/jpeg-xl/lib/jxl/color_management.cc
17:20.47 during GIMPLE pass: fre
17:20.47 /home/sharkcz/projects/firefox/third_party/jpeg-xl/lib/jxl/color_management.cc: In function ‘V jxl::N_SVE::FastLog2f(DF, V) [with DF = hwy::N_SVE::Simd<float, 64, 0>; V = __SVFloat32_t]’:
17:20.47 /home/sharkcz/projects/firefox/third_party/jpeg-xl/lib/jxl/color_management.cc:876:1: internal compiler error: in eliminate_stmt, at tree-ssa-sccvn.cc:6870
17:20.47   876 | }  // namespace jxl
17:20.47       | ^
17:20.53 Please submit a full bug report, with preprocessed source.
17:20.53 See <http://bugzilla.redhat.com/bugzilla> for instructions.
17:29.33 Preprocessed source stored into /tmp/ccRu3su7.out file, please attach this to your bugreport.
17:29.33 gmake[4]: *** [/home/sharkcz/projects/firefox/config/rules.mk:667: color_management.o] Error 1


Reproducible: Always

Comment 1 Dan Horák 2023-06-20 15:34:54 UTC
Created attachment 1971744 [details]
preprocessed source

Comment 2 Dan Horák 2023-06-20 15:37:39 UTC
tested with gcc-13.1.1-4.fc38.aarch64

from running under gdb
...
[Switching to Thread 0xfffff7ff2020 (LWP 88707)]

Thread 2.1 "cc1plus" hit Breakpoint 1, internal_error (gmsgid=gmsgid@entry=0x1cdebc0 "in %s, at %s:%d") at ../../gcc/diagnostic.cc:2264
2264	  global_dc->diagnostic_group_nesting_depth++;
(gdb) bt
#0  internal_error (gmsgid=gmsgid@entry=0x1cdebc0 "in %s, at %s:%d") at ../../gcc/diagnostic.cc:2264
#1  0x0000000000be96d8 in fancy_abort (file=<optimized out>, line=6870, function=0x1b17738 "eliminate_stmt") at ../../gcc/diagnostic.cc:2255
#2  0x00000000010970b4 in eliminate_dom_walker::eliminate_stmt (this=this@entry=0xffffffffd278, b=<optimized out>, gsi=0xffffffffd188) at ../../gcc/tree-ssa-sccvn.cc:6870
#3  0x0000000001093fa8 in eliminate_dom_walker::before_dom_children (this=0xffffffffd278, b=0xffffd7810300) at ../../gcc/tree-ssa-sccvn.cc:7304
#4  0x0000000000f741d8 in dom_walker::walk (this=0xffffffffd278, bb=0xffffd7810300) at ../../gcc/domwalk.cc:311
#5  0x0000000001093e70 in eliminate_with_rpo_vn (inserted_exprs=<optimized out>) at ../../gcc/tree-ssa-sccvn.cc:7484
#6  0x0000000000ff4598 in do_rpo_vn_1 (fn=0xffffd7ec05c0, entry=<optimized out>, exit_bbs=0x0, iterate=<optimized out>, eliminate=true, kind=<optimized out>)
    at ../../gcc/tree-ssa-sccvn.cc:8597
#7  0x000000000108e0d4 in (anonymous namespace)::pass_fre::execute (this=0x221cff0, fun=0xffffd7ec05c0) at ../../gcc/tree-ssa-sccvn.cc:8683
#8  0x0000000000d66d10 in execute_one_pass (pass=0x221cff0) at ../../gcc/passes.cc:2651
#9  0x0000000000e09c44 in execute_pass_list_1 (pass=0x221cff0) at ../../gcc/passes.cc:2760
#10 execute_pass_list_1 (pass=0x221ccd0) at ../../gcc/passes.cc:2761
#11 0x0000000000e097c8 in execute_pass_list (fn=<optimized out>, pass=<optimized out>) at ../../gcc/passes.cc:2771
#12 0x0000000000d79dc0 in do_per_function_toporder (callback=0xe097a0 <execute_pass_list(function*, opt_pass*)>, data=0x221cad0) at ../../gcc/passes.cc:1780
#13 0x00000000014c3a90 in execute_ipa_pass_list (pass=0x221ca70) at ../../gcc/passes.cc:3105
#14 0x00000000014c2d40 in ipa_passes () at ../../gcc/cgraphunit.cc:2210
#15 symbol_table::compile (this=0xffffea206000) at ../../gcc/cgraphunit.cc:2331
#16 0x00000000014c05c4 in symbol_table::finalize_compilation_unit (this=0xffffea206000) at ../../gcc/cgraphunit.cc:2583
#17 0x00000000014a2dc4 in compile_file () at ../../gcc/toplev.cc:474
#18 0x0000000001448bfc in do_compile (no_backend=<optimized out>) at ../../gcc/toplev.cc:2128
#19 toplev::main (this=this@entry=0xffffffffd8f8, argc=<optimized out>, argv=<optimized out>) at ../../gcc/toplev.cc:2282
#20 0x0000000001447ec8 in main (argc=<optimized out>, argv=<optimized out>) at ../../gcc/main.cc:39

Comment 3 Dan Horák 2023-07-31 12:27:02 UTC
still present in gcc-13.2.1-1.fc38.aarch64

Comment 4 Dan Horák 2023-07-31 13:57:51 UTC
no options except -O<num> are need to reproduce the crash, it fails with -Og, -O1, -O2, -O3, but when -O<num> is omitted completely, then the source file is compiled

Comment 5 Jakub Jelinek 2023-10-11 08:06:19 UTC
Seems this was fixed with https://gcc.gnu.org/r13-7661 aka https://gcc.gnu.org/PR110280 fix, which is included in gcc-13.2.1-2.fc{39,40}.aarch64.

Comment 6 Dan Horák 2023-10-11 09:47:41 UTC
Thanks for the details, also confirmed with a successful Firefox build.

Comment 7 Fedora Update System 2023-10-12 06:46:44 UTC
FEDORA-2023-5ddd12e8da has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-5ddd12e8da

Comment 8 Fedora Update System 2023-10-13 03:23:15 UTC
FEDORA-2023-5ddd12e8da has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-5ddd12e8da`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-5ddd12e8da

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2023-10-14 01:31:39 UTC
FEDORA-2023-5ddd12e8da has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.