------- Comment #5 from joseph at codesourcery dot com 2008-07-15 15:41 ------- Subject: Re: New: newlib:libm/math/k_rem_pio2.c fails in reload
Please try this patch. The m32c target seems to be generating its own invalid addresses and reloads for them, for reasons I don't quite understand, so something like this looks like it's needed to avoid reload generating further reloads in those cases. Index: config/m32c/m32c.c =================================================================== --- config/m32c/m32c.c (revision 137836) +++ config/m32c/m32c.c (working copy) @@ -1778,6 +1778,8 @@ /* Addressing Modes */ +#define BIG_FB_ADJ 0 + /* Used by GO_IF_LEGITIMATE_ADDRESS. The r8c/m32c family supports a wide range of non-orthogonal addressing modes, including the ability to double-indirect on *some* of them. Not all insns @@ -1895,6 +1897,17 @@ return 0; } } + if (RTX_IS ("++rii")) + { + rtx reg = patternr[2]; + HOST_WIDE_INT offs = INTVAL (patternr[3]); + + /* Avoid reloads for addresses generated by + m32c_legitimize_reload_address being generated by + find_reloads_subreg_address. */ + if (REGNO (reg) == FB_REGNO && offs == -BIG_FB_ADJ) + return 1; + } return 0; } @@ -1942,8 +1955,6 @@ frame, so the third case seems best. Note that we subtract the zero, but detect that in the addhi3 pattern. */ -#define BIG_FB_ADJ 0 - /* Implements LEGITIMIZE_ADDRESS. The only address we really have to worry about is frame base offsets, as $fb has a limited displacement range. We deal with this by attempting to reload $fb -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36827