This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: [patch] MIPS gas problems with gcc's explicit relocs


Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de> writes:
> The case which led to this whole thing is IMHO a compiler bug/feature

't ain't a bug!

> which leads to invalid memory references fed to the dla macro.
> Basically, I see three ways to handle this:
>
> - Add a "memory address" constraint to the compiler in addition to
>   the "memory content" aka "m" constraint.

There already is a memory address constaint ("p"), but I'm not sure
whether it can be reliably used in asms.  It wouldn't help anyway.
The whole point is that, as far as gcc is concerned, "%lo(symbol)($reg)"
is a valid memory address.  (An expression is only a valid memory reference
for "m" if the address is also valid.)

> - Work around the problem by not using "m" constraints for (d)la in
>   the inline assembler, that is instead of
>
> 	asm("dla\t%0,%1" : "=r" (result) : "m" (foo));
>
>   something like
>
> 	asm("dla\t%0,foo" : "=r" (result));

The current gas behaviour makes the original asm invalid.  If you
believe that the current gas behaviour is correct, then I don't see
this option as a workaround.  I think it's the correct solution.

Richard


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