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

            Bug ID: 104868
           Summary: powerpc: Compiling libgfortran with -flto failing with
                    GCC 12
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msc at linux dot ibm.com
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Compiling libgfortran with -flto (see patch [1]) on ppc64le used to work for a
good while until GCC commit r12-7501-g1301d7f647c7ac . Now it fails with:

/home/tcbot/bot-worker/at/src/at16.0-0-alpha.redhat-8_ppc64le_ppc64le/sources/gcc/libgfortran/generated/maxloc0_16_i1.c:
In function 'mmaxloc0_16_i1':
/home/tcbot/bot-worker/at/src/at16.0-0-alpha.redhat-8_ppc64le_ppc64le/sources/gcc/libgfortran/generated/maxloc0_16_i1.c:362:1:
error: insn does not satisfy its constraints:
  362 | }
      | ^
(insn 4106 126 4107 236 (set (reg:V2DI 65 1)
        (vec_duplicate:V2DI (reg:DI 0 0 [1496])))
"/home/tcbot/bot-worker/at/src/at16.0-0-alpha.redhat-8_ppc64le_ppc64le/sources/gcc/libgfortran/generated/maxloc0_16_i1.c":315:36
1477 {vsx_splat_v2di_reg}
     (expr_list:REG_DEAD (reg:DI 0 0 [1496])
        (nil)))
during RTL pass: cprop_hardreg
/home/tcbot/bot-worker/at/src/at16.0-0-alpha.redhat-8_ppc64le_ppc64le/sources/gcc/libgfortran/generated/maxloc0_16_i1.c:362:1:
internal compiler error: in extract_constrain_insn, at recog.cc:2670
0x7fff8cce171b __libc_start_call_main
        ../sysdeps/nptl/libc_start_call_main.h:58
0x7fff8cce18f7 generic_start_main
        ../csu/libc-start.c:392
0x7fff8cce18f7 __libc_start_main_impl
        ../sysdeps/unix/sysv/linux/powerpc/libc-start.c:98
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
lto-wrapper: fatal error:
/home/tcbot/bot-worker/at/src/at16.0-0-alpha.redhat-8_ppc64le_ppc64le/builds/gcc_power10.tuned/./gcc/xgcc
returned 1 exit status
compilation terminated.
/home/tcbot/bot-worker/at_opt/at-next-16.0-0-alpha/powerpc64le-linux-gnu/bin/ld:
error: lto-wrapper failed
collect2: error: ld returned 1 exit status

Steps to reproduce on a Power10:

cd gcc
wget
https://raw.githubusercontent.com/powertechpreview/powertechpreview/0be24b142a81e44ac4abadb3fde4eb0010b79f70/GCC%20PowerPC%20Backport/9/gcc-9-lto.patch
patch -p1 < gcc-9-lto.patch

cd build/gcc
CFLAGS=-O2 CXXFLAGS=-O2 CFLAGS_FOR_TARGET=-O3 CXXFLAGS_FOR_TARGET=-O3
~/src/gcc/configure --build=powerpc64le-linux-gnu --host=powerpc64le-linux-gnu
--target=powerpc64le-linux-gnu --cache-file=configparms
--prefix=/home/mscastanho/usr --with-long-double-128 --enable-secureplt
--disable-multilib --enable-threads=posix --enable-languages=c,c++,fortran,go
--enable-__cxa_atexit --enable-shared --enable-checking=release
--enable-gnu-indirect-function --enable-lto --enable-linker-build-id
--disable-bootstrap --without-ppl --without-cloog --without-libelf
--with-system-zlib --with-cpu=power10 --with-tune=power10 && make -j60 &>
_make; echo $?


[1]
https://raw.githubusercontent.com/powertechpreview/powertechpreview/0be24b142a81e44ac4abadb3fde4eb0010b79f70/GCC%20PowerPC%20Backport/9/gcc-9-lto.patch

Reply via email to