Bug 2190219

Summary: internal compiler error while building Erlang with GCC 13.1.1 on aarch64
Product: [Fedora] Fedora Reporter: Peter Lemenkov <lemenkov>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dmalcolm, fweimer, jakub, jlaw, jwakely, mcermak, mpolacek, msebor, nickc, sipoyare
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gcc-13.1.1-2.fc38 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-15 01:27:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Build log none

Description Peter Lemenkov 2023-04-27 15:04:06 UTC
Created attachment 1960416 [details]
Build log

I've got an internal compiler error when I build recent Erlang 25.3.1 on aarch64 with GCC 13:

===
g++ -DASMJIT_EMBED=1 -DASMJIT_NO_BUILDER=1 -DASMJIT_NO_DEPRECATED=1 -DASMJIT_STATIC=1 -DASMJIT_NO_FOREIGN=1 -Iaarch64-redhat-linux-gnu/opt/jit -Ibeam -Isys/unix -Isys/common -Iaarch64-redhat-linux-gnu -Ipcre -Iryu -I../include -I../include/aarch64-redhat-linux-gnu -I../include/internal -I../include/internal/aarch64-redhat-linux-gnu -Ibeam/jit -Ibeam/jit/arm                        \
           -Werror=undef -Werror=return-type -fno-strict-aliasing -fno-common  -O3 -fno-omit-frame-pointer -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -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 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fno-strict-aliasing -I/builddir/build/BUILD/otp-OTP-25.3.1/erts/aarch64-redhat-linux-gnu -D_GNU_SOURCE -DHAVE_CONFIG_H -Wall -Wpointer-arith -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -DPOSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -DBEAMASM=1  -O3 -fno-omit-frame-pointer -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -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  -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fno-strict-aliasing -std=c++17                \
          -include aarch64-redhat-linux-gnu/opt/jit/asmjit/asmjit.hpp -c beam/jit/beam_jit_common.cpp -o obj/aarch64-redhat-linux-gnu/opt/jit/beam_jit_common.o
make[4]: Leaving directory '/builddir/build/BUILD/otp-OTP-25.3.1/erts/emulator'
*** WARNING *** there are active plugins, do not report this as a bug unless you can reproduce it without enabling any plugins.
Event                            | Plugins
PLUGIN_FINISH_UNIT               | annobin: Generate final annotations
PLUGIN_START_UNIT                | annobin: Generate global annotations
PLUGIN_ALL_PASSES_START          | annobin: Generate per-function annotations
PLUGIN_ALL_PASSES_END            | annobin: Register per-function end symbols
In file included from beam/jit/beam_jit_common.cpp:21:
beam/jit/beam_jit_common.hpp: In function 'constexpr Uint beam_jit_set_bsc_segment_op(Uint, JitBSCOp)':
beam/jit/beam_jit_common.hpp:148:76: internal compiler error: in aarch64_function_arg_alignment, at config/aarch64/aarch64.cc:7498
  148 | static constexpr Uint beam_jit_set_bsc_segment_op(Uint segment, JitBSCOp op) {
      |                                                                            ^
Please submit a full bug report, with preprocessed source.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccocWo8i.out file, please attach this to your bugreport.
make[4]: *** [aarch64-redhat-linux-gnu/Makefile:933: obj/aarch64-redhat-linux-gnu/opt/jit/beam_jit_common.o] Error 1
make[4]: *** Waiting for unfinished jobs....

===

GCC on the rest arches compiles Erlang just fine:

https://koji.fedoraproject.org/koji/taskinfo?taskID=100451822

Comment 1 Fedora Update System 2023-05-12 12:50:30 UTC
FEDORA-2023-bcc40d5f14 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-bcc40d5f14

Comment 2 Peter Lemenkov 2023-05-12 17:42:12 UTC
I can confirm that gcc-13.1.1-2.fc38 fixed it. Could you backport it to f38 as well?

Comment 3 Peter Lemenkov 2023-05-12 17:44:21 UTC
Ah sorry it is alreado built for f38, so we need just wait until it hits stable.

Comment 4 Fedora Update System 2023-05-13 03:44:15 UTC
FEDORA-2023-bcc40d5f14 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-bcc40d5f14`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-bcc40d5f14

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

Comment 5 Fedora Update System 2023-05-15 01:27:04 UTC
FEDORA-2023-bcc40d5f14 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.