Your change to final.c

Richard Earnshaw rearnsha@arm.com
Fri Oct 19 09:32:00 GMT 2001


Richard,

Your latest change to final.c breaks the ARM bootstrap.  There's nothing 
in the spec for an ASM that says that the number of references to the 
operands must be less that MAX_RECOG_OPERANDS (which is an internal 
definition anyway), so we are overflowing this array when we try to output 
the following ASM statement:

#define umul_ppmm(xh, xl, a, b) \
{register USItype __t0, __t1, __t2;                                     \
  __asm__ ("%@ Inlined umul_ppmm\n"                                     \
           "    mov     %2, %5, lsr #16\n"                              \
           "    mov     %0, %6, lsr #16\n"                              \
           "    bic     %3, %5, %2, lsl #16\n"                          \
           "    bic     %4, %6, %0, lsl #16\n"                          \
           "    mul     %1, %3, %4\n"                                   \
           "    mul     %4, %2, %4\n"                                   \
           "    mul     %3, %0, %3\n"                                   \
           "    mul     %0, %2, %0\n"                                   \
           "    adds    %3, %4, %3\n"                                   \
           "    addcs   %0, %0, #65536\n"                               \
           "    adds    %1, %1, %3, lsl #16\n"                          \
           "    adc     %0, %0, %3, lsr #16"                            \
           : "=&r" ((USItype) (xh)),                                    \
             "=r" ((USItype) (xl)),                                     \
             "=&r" (__t0), "=&r" (__t1), "=r" (__t2)                    \
           : "r" ((USItype) (a)),                                       \
             "r" ((USItype) (b)));}

This has 33 references to operands, but MAX_RECOG_OPERANDS is only 30, so 
we end up running off the end of the oporder array.

R.



More information about the Gcc-bugs mailing list