Mail Archives: djgpp/2000/04/14/03:55:20
OKay, but is the ``: "g" (value)'' invalid thing unsupported by GCC/AS?
If not, what are the actual limitations/restrictions to it?
I've never seen such ones. Just only a limit of up to 6 arguments, if all they
are put to the conventional registers (EAX,EBX,ECX,EDX,ESI,EDI).
Is there something extra I should know for using :"g"() correctly?
Why GCC/AS accept *different rules* of inline ASM under different optimization
switches?
thanks.
Alexei A. Frounze
-----------------------------------------
Homepage: http://alexfru.chat.ru
Mirror: http://members.xoom.com/alexfru
Eli Zaretskii wrote:
>
> "Alexei A. Frounze" wrote:
> >
> > Steamer wrote:
> > > The bugs in your code are in the interface between the C and the inline
> > > assembly. They may not cause a problem if you don't use -O2, but they
> > > surely will as soon as the optimizer starts trying to rearrange things,
> > > remove redundant instructions, avoid unnecessary memory access, etc.
> >
> > Thus design of the optimizer is buggy as well. :))
>
> No, the optimizer is okay, and the interface between GCC and Gas is okay as
> well. You just need to put into the inline assembly the necessary magic
> (constraints and clobbered registers) to let GCC know enough about the inline
> fragment so that it could Do The Right Thing.
>
> However, if you intend purposefully to fight GCC and deliberately not abide
> by the rules of correct inline assembly, don't be surprised if GCC and Gas
> will fight back and produce invalid code... ;-)
- Raw text -