https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110627
Bug ID: 110627 Summary: m68k: “Tried to convert PC relative branch to absolute jump” while building iconvdata/iso-2022-jp.c from glibc Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: fw at gcc dot gnu.org Target Milestone: --- Target: m68k-linux-gnu-coldfire-soft Created attachment 55521 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55521&action=edit iso-2022-jp.i The attached source file fails in assembly with: Fatal error: Tried to convert PC relative branch to absolute jump when building with “-O2 -fpic” or “-O2 -fPIC”. GCC was configured like this (trunk sources from today): /home/bmg/src/gcc/configure --prefix=/home/bmg/install/compilers/m68k-linux-gnu-coldfire-soft --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=m68k-glibc-linux-gnu --with-sysroot=/home/bmg/install/compilers/m68k-linux-gnu-coldfire-soft/sysroot --with-arch=cf --with-cpu=54455 --disable-multilib --enable-initfini-array --disable-libssp --disable-libcilkrts --with-gmp=/home/bmg/install/host-libraries --with-mpfr=/home/bmg/install/host-libraries --with-mpc=/home/bmg/install/host-libraries --enable-languages=c --disable-shared --disable-threads --disable-libatomic --disable-decimal-float --disable-gcov --disable-libffi --disable-libgomp --disable-libitm --disable-libmpx --disable-libquadmath --disable-libsanitizer --without-headers --with-newlib --with-glibc-version=2.37 As a workaround, I tried “-O2 -fpic -mpcrel“, but this ICEs: during RTL pass: sched2 In file included from iso-2022-jp.c:1033: ../iconv/skeleton.c: In function ‘gconv’: ../iconv/skeleton.c:663:1: internal compiler error: in sched_attr_op_type, at config/m68k/m68k.cc:6123 0x741144 sched_attr_op_type /home/bmg/src/gcc/gcc/config/m68k/m68k.cc:6123 0x11ba2d1 m68k_sched_attr_opy_type(rtx_insn*, int) /home/bmg/src/gcc/gcc/config/m68k/m68k.cc:6180 0x11b0564 sched_get_opxy_mem_type /home/bmg/src/gcc/gcc/config/m68k/m68k.cc:6354 0x11ba32e m68k_sched_attr_op_mem(rtx_insn*) /home/bmg/src/gcc/gcc/config/m68k/m68k.cc:6387 0x14cd471 internal_dfa_insn_code(rtx_insn*) /home/bmg/src/gcc/gcc/config/m68k/m68k.md:154 0x14c9334 dfa_insn_code /home/bmg/build/compilers/m68k-linux-gnu-coldfire-soft/gcc-first/gcc/insn-automata.cc:4146 0x14c9334 insn_has_dfa_reservation_p(rtx_insn*) /home/bmg/build/compilers/m68k-linux-gnu-coldfire-soft/gcc-first/gcc/insn-automata.cc:4788 0x11b1cac m68k_sched_md_init_global /home/bmg/src/gcc/gcc/config/m68k/m68k.cc:6714 0x15d1c2f sched_init() /home/bmg/src/gcc/gcc/haifa-sched.cc:7354 0x15d33fc haifa_sched_init() /home/bmg/src/gcc/gcc/haifa-sched.cc:7368 0xdf7ffa schedule_insns() /home/bmg/src/gcc/gcc/sched-rgn.cc:3524 0xdf86fd schedule_insns() /home/bmg/src/gcc/gcc/sched-rgn.cc:3518 0xdf86fd rest_of_handle_sched2 /home/bmg/src/gcc/gcc/sched-rgn.cc:3756 0xdf86fd execute /home/bmg/src/gcc/gcc/sched-rgn.cc:3895 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.