Hi,

this patch from Vladimir fixes an ICE when compiling newlib in Thumb1.
 It returns NO_REGS in THUMB_SECONDARY_OUTPUT_RELOAD_CLASS, the same
way we did for THUMB_SECONDARY_INPUT_RELOAD_CLASS.

The testsuite is OK with this patch, but as we have also a regression
on iWMMXT, I tried to avoid the secondary reload restriction at a
higher level : in SECONDARY_[INPUT|OUTPUT]_RELOAD_CLASS, as these
macros handle the iWMMXT target.  Unfortunately it doesn't fix the
issue, but the testsuite results are the same as with the attached
patch.

It seems to me that this second solution is more LRA friendly (i.e.
doing less thing on the target side) but I want your opinion.

If the Thumb fix is sufficient, here is the Changelog

2013-12-18  Vladimir Makarov  <vmaka...@redhat.com>

        * config/arm/arm.h (THUMB_SECONDARY_OUTPUT_RELOAD_CLASS): Return NO_REGS
        for LRA.

Thanks,
Yvan
Index: config/arm/arm.h
===================================================================
--- config/arm/arm.h    (revision 206023)
+++ config/arm/arm.h    (working copy)
@@ -1285,11 +1285,12 @@ enum reg_class
       : NO_REGS))
 
 #define THUMB_SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X)            \
-  ((CLASS) != LO_REGS && (CLASS) != BASE_REGS                          \
-   ? ((true_regnum (X) == -1 ? LO_REGS                                 \
-       : (true_regnum (X) + HARD_REGNO_NREGS (0, MODE) > 8) ? LO_REGS  \
-       : NO_REGS))                                                     \
-   : NO_REGS)
+  (lra_in_progress ? NO_REGS                                           \
+   : (CLASS) != LO_REGS && (CLASS) != BASE_REGS                                
\
+      ? ((true_regnum (X) == -1 ? LO_REGS                              \
+         : (true_regnum (X) + HARD_REGNO_NREGS (0, MODE) > 8) ? LO_REGS        
\
+         : NO_REGS))                                                   \
+      : NO_REGS)
 
 /* Return the register class of a scratch register needed to copy IN into
    or out of a register in CLASS in MODE.  If it can be done directly,

Reply via email to