This is the mail archive of the gcc@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: gcc-4.1-20050709: alpha: "macro requires $at register whilenoat in effect" while compiling Linux kernel


Dan Kegel <dank@kegel.com> writes:

> Can somebody familiar with inline assembly guess whether the source
> or the compiler are wrong here?
>
> --- snip ---
> inline unsigned int
> cia_bwx_ioread8(void *a)
> {
>   return ({ unsigned char __kir; __asm__("ldbu %0,%1" : "=r"(__kir) : "m"(*(volatile unsigned char *)a)); __kir; });
> }
> --- snip ---
>
> $ alpha-unknown-linux-gnu-gcc -fno-common -ffreestanding -O2 \
> -mno-fp-regs -ffixed-8 -msmall-data -mcpu=ev5 -Wa,-mev6 -c core_cia.i
>
> /tmp/ccmvyEzr.s: Assembler messages:
> /tmp/ccmvyEzr.s:16: Error: macro requires $at register while noat in effect

The "ldbu" instruction is only available on ev56 and above, however,
gcc4.1 emits ".arch ev5" because of "-mcpu=ev5", which overrides as's
"-mev6". This used to work because 4.0 didn't output ".arch ev5"
because it doesn't actually do anything important.

I don't see any fault on gcc's side here. You could argue that the
command line option for as should override the ".arch", but I think
it's been like this forever. So you should probably just add ".arch
ev6" inside the asm (annoyingly, gas doesn't seem to have ".arch any"
or similar).

-- 
	Falk


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