https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113941
--- Comment #1 from Jeffrey A. Law <law at gcc dot gnu.org> --- Not really working on this and I'm not going to lose sleep if this port is deprecated. But in case someone does care, here's a couple hints. First the mn103 port will trip an internal consistency check in LRA. This is a quirk in how LRA checks for secondary reloads. If a pseudo is allocated into an eliminable hard reg (say the frame pointer if we didn't need the frame pointer), then the register class used for determining secondary reloads will be the class of the elimination target register, ie sp. This patch makes the secondary reload code consistent: diff --git a/gcc/config/mn10300/mn10300.cc b/gcc/config/mn10300/mn10300.cc index 1cf08114bd9..0d6a0dd99f7 100644 --- a/gcc/config/mn10300/mn10300.cc +++ b/gcc/config/mn10300/mn10300.cc @@ -1369,7 +1369,12 @@ mn10300_secondary_reload (bool in_p, rtx x, reg_class_t rclass_i, if (xregno >= FIRST_PSEUDO_REGISTER) xregno = true_regnum (x); if (xregno != INVALID_REGNUM) - xclass = REGNO_REG_CLASS (xregno); + { + if (!in_p && xregno == FRAME_POINTER_REGNUM) + xclass = SP_REGS; + else + xclass = REGNO_REG_CLASS (xregno); + } } if (!TARGET_AM33) Second, the compiler will go into an infinite loop in LRA. I haven't really investigated deeply.