JDK-8338660 : Linux aarch64 musl produces internal compiler error: in curr_insn_transform, at lra-constraints.c:3962
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 24
  • Priority: P4
  • Status: Closed
  • Resolution: External
  • Submitted: 2024-08-20
  • Updated: 2024-08-22
  • Resolved: 2024-08-22
Related Reports
Relates :  
Description
After applying changes related to JDK-8315884 the following build failure was observed when building Linux aarch64 musl:

===============================8<-------------------------------
. . .
Compiling up to 55 files for jdk.jpackage
/workspace/github/JetBrainsRuntime_dev/src/hotspot/share/runtime/synchronizer.cpp: In static member function 'static intptr_t ObjectSynchronizer::FastHashCode(Thread*, oop)':
/workspace/github/JetBrainsRuntime_dev/src/hotspot/share/runtime/synchronizer.cpp:1116:1: error: unable to generate reloads for:
 1116 | }
      | ^
(insn 565 564 566 28 (set (reg/v:DI 2 x2 [ reg2 ])
        (ior:DI (and:DI (ashift:DI (reg/v:DI 188 [ <retval> ])
                    (const_int 8 [0x8]))
                (const_int 549755813632 [0x7fffffff00]))
            (and:DI (reg/v:DI 1 x1 [ reg1 ])
                (const_int -549755813633 [0xffffff80000000ff])))) "/workspace/github/JetBrainsRuntime_dev/src/hotspot/os_cpu/linux_aarch64/atomic_linux_aarch64.hpp":49:21 792 {*aarch64_bfidi5_shift_alt}
     (nil))
during RTL pass: reload
/workspace/github/JetBrainsRuntime_dev/src/hotspot/share/runtime/synchronizer.cpp:1116:1: internal compiler error: in curr_insn_transform, at lra-constraints.c:3962
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
make[3]: *** [lib/CompileJvm.gmk:168: /workspace/github/JetBrainsRuntime_dev/build/linux-aarch64-server-release/hotspot/variant-server/libjvm/objs/synchronizer.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [make/Main.gmk:245: hotspot-server-libs] Error 2

ERROR: Build failed for target 'images' in configuration 'linux-aarch64-server-release' (exit code 2) 
. . .
===============================8<———————————————

note:  Linux x86_64 musl is successful.

After reverting the following changes, the aarch64 build becomes successful
 - 8337987: Relocate jfr and throw_exception stubs from StubGenerator to SharedRuntime (https://github.com/openjdk/jdk/commit/f0374a0bc181d0f2a8c0aa9aa032b07998ffaf60)
 - 8315884: New Object to ObjectMonitor mapping (https://github.com/openjdk/jdk/commit/bd4160cea8b6b0fcf0507199ed76a12f5d0aaba9)

How to reproduce:

Building for aarch64 is started within a docker container.
Image of this container may be found at
-  https://hub.docker.com/layers/jetbrains/runtime/jbr21env_musl_aarch64/images/sha256-ef9a642934f04ec50598b3f920e468d5dc01a5691f7693b34a4e37e5d25c4658 

The docker file may be found here:
- https://github.com/JetBrains/JetBrainsRuntime/blob/main/jb/project/docker/Dockerfile.musl_aarch64

the preprocessed source was attached - see synchronizer.tgz
Comments
The issue was observed with gcc 9.3.0 After upgrading docker image up to alpine:3.14 with gcc 10.3.1 build became successful
22-08-2024

This bug should be reported to GCC. In particular, they'll need preprocessed source code and information about the exact version of GCC.
21-08-2024