This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [m68k] Fix m68k-netbsdelf bootstrap


Gunther Nikl wrote:
On Wed, Jan 14, 2004 at 12:49:37AM +0100, Bernardo Innocenti wrote:
Anyway, I like seeing "fp" in GCC's output as it helps reading
the code.  Could we add yet another hook in m68k.h such as

 #undef M68K_FP_REG_NAME
 #define M68K_FP_REG_NAME "fp"

?

The problem I have with this is the fact %FP might be bound to a different register, eg. with m68k-amigaos %FP == %A5.

My upcoming patch should fix this too. I use this macro to print registers everywhere in m68k.c:

/* 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)])

#define M68K_FP_REG_NAME REGISTER_PREFIX"fp"


On second tought, this may actually be a *bug*. It would break on any target where FRAME_POINTER_REGNUM != 14 unless gas is also patched accordingly.

A quick look at gas/config/tc-m68k.c reveals fp is hardly
bound to a6.

So it seems we need some ugly work-around:

#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

--
 // Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/  http://www.develer.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]