https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121394

            Bug ID: 121394
           Summary: [16 Regression][gcn] Since r16-2595-gf1c80147641783:
                    link-time error: libm_a-e_atan2.o):(.rodata.cst32):
                    SHF_MERGE section size (56) must be a multiple of
                    sh_entsize (32)
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: ams at gcc dot gnu.org, pinskia at gcc dot gnu.org
  Target Milestone: ---
            Target: gcn

When compiling + linking libgomp.fortran/fortran-torture_execute_math.f90
with AMD GCN offloading enabled ("-fopenmp -foffload=amdgcn-amdhsa" + in-tree
build of newlib), it fails with:

ld: error:
.../x86_64-pc-linux-gnu/16.0.0/accel/amdgcn-amdhsa/../../../../../../amdgcn-amdhsa/lib/gfx900/libm.a(libm_a-e_atan2.o):(.rodata.cst32):
SHF_MERGE section size (56) must be a multiple of sh_entsize (32)

collect2: error: ld returned 1 exit status
gcn mkoffload: fatal error: .../bin/x86_64-pc-linux-gnu-accel-amdgcn-amdhsa-gcc
returned 1 exit status
compilation terminated.

* * *

Bisecting points to:

commit r16-2595-gf1c8014764178335e3b949e06b894ff5775beae5
Author:     Andrew Pinski
AuthorDate: Fri Jul 25 16:16:36 2025 -0700
Commit:     Andrew Pinski
CommitDate: Mon Jul 28 23:43:32 2025 -0700

    Improve mergability of CSWTCH [PR120523]

* * *

The file $(build)/amdgcn-amdhsa/newlib/libm/math/libm_a-e_atan2.s has:

--- libm_a-e_atan2.s-old       2025-08-04 12:53:47.395611975 +0200
+++ libm_a-e_atan2.s-new       2025-08-04 13:11:52.569728506 +0200
@@ -544,19 +544,19 @@
 .LFE14:
        .size   __ieee754_atan2, .-__ieee754_atan2
-       .section        .rodata
-       .align  16
+       .section        .rodata.cst32,"aM",@progbits,32
+       .align  32
        .type   CSWTCH.7, @object
        .size   CSWTCH.7, 24
 CSWTCH.7:
        .long   0
        .long   -2147483648
        .long   1413754136
        .long   1074340347
        .long   1413754136
        .long   -1073143301
-       .align  16
+       .align  32
        .type   CSWTCH.6, @object
        .size   CSWTCH.6, 24
 CSWTCH.6:
        .long   1413754136
        .long   -1075240453

Reply via email to