On 12/13/2013, 8:07 AM, Yvan Roux wrote:
Thanks for your help Vlad. Another bad news about this PR fix, is
that it has resurrected the thumb_movhi_clobber bug (PR 58785) but in
a different manner as the original failing testcase still pass. I
attached a testcase to be compiled with :
cc1 -mthumb -mcpu=cortex-m0 -O2 m.c
And Thumb bootstrap seems to be broken with an ICE in check_rtl, I'm
checking if it is the same issue.
The compiler crashes because a reload pattern is trying to take address
of memory which is actually a spilled pseudo for LRA. The pattern is
designed for reload which always uses memory not a spilled pseudo as LRA
does.
But we don't need to adjust the pattern for LRA. LRA can manage by
itself without reload patterns.
I found that I missed to switch off these patterns for LRA fully. The
following patch solves the problem. The same was done for
THUMB_SECONDARY_INPUT_RELOAD_CLASS long ago.
Yvan, could go from this patch by yourself. I mean testing and getting
its approval from an ARM maintainer. Thanks.
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,