This is the mail archive of the gcc-bugs@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]

[Bug rtl-optimization/44288] [Extended inline asm] wrong assembly generation on IA32



------- Comment #8 from dg dot recrutement31 at gmail dot com  2010-05-27 12:05 -------
(In reply to comment #7)
> You are wrong.  It is user's responsibility to choose correct constraints for
> the inline assembly, the compiler doesn't try to understand what the inline
> assembly is doing or even check its semantics, all it does is perform
> replacements in it (replacing %0, %1, %2 in this case).
> Not every constraint is suitable for every use in the assembly obviously,
> otherwise we wouldn't need multiple constraints.
> The "g" constraint allows a register, immediate or memory, all must be valid in
> the instruction and it is up to the compiler which one it chooses.
> "g" constraint is usable say for mov eax, %2; which can work well with
> registers, immediates or memory.  But as you use [%2] instead, memory isn't
> valid, all that is valid is either a register or register + immediate or
> register + X*register2 + immediate (the usual i?86 addressing modes).

Thank a lot,

I fully understand my mistake.

Sorry for disturbance

Regards


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44288


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