Subject: Re: mac68k and gcc 4
To: None <khym@azeotrope.org>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: current-users
Date: 09/05/2006 22:44:15
khym@azeotrope.org wrote:
> (caddr_t *)prev = &mrg_DTList;
>
> I think changing the last line to:
> prev = (caddr_t)&mrg_DTList;
> will do the same thing.
This looks fixed already.
> /usr/src.local/sys/arch/mac68k/mac68k/macrom.c: In function 'mrg_aline_super':
> /usr/src.local/sys/arch/mac68k/mac68k/macrom.c:728: error: unknown register name 'fp' in 'asm'
:
> #ifdef __ELF__
> "fp"
> #else
> "a6"
> #endif
>
> I don't know why the clobber register spec is "fp" for ELF and "a6"
> otherwise... isn't "fp" just an alias for "a6"?
Maybe binutils-2.9.x or egcs-2.91.x restriction when m68k ports
switched to ELF.
> I tried changing it to
> use "a6" unconditionally, but that doesn't work either:
> /usr/src.local/sys/arch/mac68k/mac68k/macrom.c: In function 'mrg_aline_super':
> /usr/src.local/sys/arch/mac68k/mac68k/macrom.c:763: error: %a6 cannot be used in asm here
> The comments say "save a6" and "restore a6", but I don't see where
> that happens. They also say that it'll possibly change A6, but I don't
> see when that would happen either. Are there some ROM toolbox calls
> that will modify A6? That seems like it'd be a bad thing for a
> subroutine to not restore the frame pointer...
>
> Anyways, I don't know if it's the right thing to do, but I just
> removed fp/a6 from the list of clobbered registers.
I guess it's okay, because as mentioned in the warning,
there is nothing to do by compiler if the frame pointer
is actually modified in the asm block.
If the called routine actually breaks the frame pointer,
we should save it before calling the function in the asm
manually, as the comment said. (but I'm not sure, maybe
port-m68k or port-toolchain is the right place to ask)
> /usr/src.local/sys/arch/m68k/m68k/pmap_motorola.c: In function 'pmap_changebit':
> /usr/src.local/sys/arch/m68k/m68k/pmap_motorola.c:2518: warning: 'pg_' may be used uninitialized in this function
> /usr/src.local/sys/arch/m68k/m68k/pmap_motorola.c:2525: warning: 'pg_' may be used uninitialized in this function
This has been fixed with a HACK. (see src/doc/HACKS)
---
Izumi Tsutsui