[Bug inline-asm/40621] GCC doesn't take into account ECX being modified inside inline assembler
--- Comment #1 from hunterggl at gmail dot com 2009-07-02 16:38 --- Created an attachment (id=18122) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18122action=view) Test file This a small fragment of code that causes problems -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40621
[Bug inline-asm/40621] GCC doesn't take into account ECX being modified inside inline assembler
--- Comment #2 from hunterggl at gmail dot com 2009-07-02 16:39 --- Created an attachment (id=18123) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18123action=view) Comparison of asm -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40621
[Bug inline-asm/40621] GCC doesn't take into account ECX being modified inside inline assembler
--- Comment #3 from pinskia at gcc dot gnu dot org 2009-07-02 16:51 --- For both mulscale and divscale you have ecx as an input register but nothing marks it as being modified so GCC does not know that. It does not read the template string to figure out what you had meant to say. -- pinskia at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40621
[Bug inline-asm/40621] GCC doesn't take into account ECX being modified inside inline assembler
--- Comment #4 from hunterggl at gmail dot com 2009-07-02 17:46 --- (In reply to comment #3) For both mulscale and divscale you have ecx as an input register but nothing marks it as being modified so GCC does not know that. It does not read the template string to figure out what you had meant to say. I see. Anyway, how do I let GCC know about it? What's the best solution? Saving ECX isn't a very good solution because it isn't always necessary. And what about other registers(EAX,EDX)? Do I have to save them too? There are many such assembler definitions so I'd like to make code behavior predictable. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40621