This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [m68k] Fix m68k-netbsdelf bootstrap
Andreas Schwab wrote:
Bernardo Innocenti <bernie@develer.com> writes:
Gunther Nikl wrote:
#if FRAME_POINTER_REGNUM == 14
/* Return a register name by index, handling fp nicely. */
# define M68K_REGNAME(r) ( \
((r) == FRAME_POINTER_REGNUM && frame_pointer_needed) ? \
M68K_FP_REG_NAME : reg_names[(r)])
#else
/* GAS and possibly other assemblers hard-code fp to a6. */
# define M68K_REGNAME(r) reg_names[(r)]
#endif
This does only work if FRAME_POINTER_REGNUM is defined correctly
before, eg. in config.gcc. However, since FRAME_POINTER_REGNUM is
a compile-time constant you could move the check into the macro
definition to get the same result :-)
No, it would work even if FRAME_POINTER_REGNUM is defined later,
for the same reason Andreas' earlier patch works: the C preprocessor
expands nested macros lazily, not at definition time.
Not in this case, since the #if expression is evaluated immediately, and
undefined macros are replaced with 0 here.
Doh!
Anyway, this conditional code is going to be ripped out
now that Gunther confirmed that GAS knows about %fp in
m68k-amigaos.
AFAIK, no other m68k targets have %fp != %a6. Even so,
they'd better patch GAS too, otherwise they'd get broken
code for asm functions and inline macros.
--
// Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/ http://www.develer.com/