The cris ports are unable to build newlib due to a reload failure.

What happens is we need to reload an auto-inc memory reference. The preferred class is GENERAL_REGS. THe register we happen to select is ACR, but ACR can not be used in an auto-inc addressing mode.

This can be easily fixed by returning GENNONACR_REGS from the preferred reload class hook instead of GENERAL_REGS.

It may be advisable to also define the LIMIT_RELOAD_CLASS hook. I haven't done that, but the port maintainers should seriously consider it.

With this change cris and crisv32 both build newlib successfully.

Installed on the trunk.

Jeff
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index 21137bd..8c134a6 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -1597,7 +1597,7 @@ cris_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, 
reg_class_t rclass)
       && rclass != SRP_REGS
       && rclass != CC0_REGS
       && rclass != SPECIAL_REGS)
-    return GENERAL_REGS;
+    return GENNONACR_REGS;
 
   return rclass;
 }

Reply via email to