https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106438
Bug ID: 106438 Summary: powerpc: ICE when building libgfortran with -lto: in insert_value_copy_on_edge, at tree-outof-ssa.cc:334 Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libfortran Assignee: unassigned at gcc dot gnu.org Reporter: msc at linux dot ibm.com Target Milestone: --- Compiling libgfortran with -lto (see small patch [1] below) is failing on powerpc64le (testd on P10, but may apply to older processors as well) with current trunk: $ git gcc-descr HEAD r12-10142-ga6efab5fbc468b $ cd ~/build/gcc/ && ~/AT/pr2981/build/sources/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=fortran --disable-bootstrap --enable-__cxa_atexit --enable-shared --enable-checking=release --enable-gnu-indirect-function --enable-lto --enable-linker-build-id --without-ppl --without-cloog --without-libelf --with-system-zlib --with-cpu=power10 --with-tune=power10 && make -j60 &> _make; echo $? Error: during RTL pass: expand /home/mscastanho/AT/pr2981/build/sources/gcc/libgfortran/generated/maxloc0_4_r17.c: In function 'maxloc0_4_r17': /home/mscastanho/AT/pr2981/build/sources/gcc/libgfortran/generated/maxloc0_4_r17.c:38:1: internal compiler error: in insert_value_copy_on_edge, at tree-outof-ssa.cc:334 38 | maxloc0_4_r17 (gfc_array_i4 * const restrict retarray, | ^ 0x108ea89b insert_value_copy_on_edge /home/mscastanho/AT/pr2981/build/sources/gcc/gcc/tree-outof-ssa.cc:334 0x108ea89b eliminate_phi /home/mscastanho/AT/pr2981/build/sources/gcc/gcc/tree-outof-ssa.cc:785 0x108ea89b expand_phi_nodes(ssaexpand*) /home/mscastanho/AT/pr2981/build/sources/gcc/gcc/tree-outof-ssa.cc:1024 0x10252a1f execute /home/mscastanho/AT/pr2981/build/sources/gcc/gcc/cfgexpand.cc:6799 Git bisect is pointing to this commit: commit 133d0d422ebd18dbd215cfa5394aff9f938e7060 Author: Jakub Jelinek <ja...@redhat.com> Date: Tue Jun 28 13:05:28 2022 +0200 fortran, libgfortran: Avoid using libquadmath for glibc 2.26+ [1] https://raw.githubusercontent.com/powertechpreview/powertechpreview/0be24b142a81e44ac4abadb3fde4eb0010b79f70/GCC%20PowerPC%20Backport/9/gcc-9-lto.patch