https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61844
--- Comment #9 from Kazumoto Kojima <kkojima at gcc dot gnu.org> --- The testcase in #7 can be compiled successfully when -mindexed-addressing is added. It looks that base+index reg addressing mode is disabled for shmedia32 and shcompact as default and it makes ira unhappy. We used to return NO_REGS for INDEX_REG_CLASS when -mindexed-addressing is disabled and it could suppress the use of reg+index addressing in the older compilers. It seems that now this isn't the right way to disable that addressing. With --- /svn/trunk/gcc/config/sh/sh.h 2014-05-14 10:20:06.526008871 +0900 +++ gcc/config/sh/sh.h 2014-07-28 14:16:51.358771570 +0900 @@ -1723,8 +1723,7 @@ struct sh_args { #define INDEX_REGISTER_RTX_P(X) MAYBE_INDEX_REGISTER_RTX_P(X, false) #endif -#define ALLOW_INDEXED_ADDRESS \ - ((!TARGET_SHMEDIA32 && !TARGET_SHCOMPACT) || TARGET_ALLOW_INDEXED_ADDRESS) +#define ALLOW_INDEXED_ADDRESS 1 /* A C compound statement that attempts to replace X, which is an address that needs reloading, with a valid memory address for an operand of my c-only sh64-elf build is completed without errors. Although I don't think the patch does the right thing, it'll prove that ALLOW_INDEXED_ADDRESS causes problems.