[Bug inline-asm/43998] inline assembler: can't set clobbering for input register

2016-06-24 Thread stsp at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43998 --- Comment #15 from Stas Sergeev --- Btw, clang seems to allow same regs in input and clobber list.

[Bug inline-asm/43998] inline assembler: can't set clobbering for input register

2016-06-24 Thread stsp at users dot sourceforge.net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43998 Stas Sergeev changed: What|Removed |Added CC||stsp at users dot sourceforge.net ---

[Bug inline-asm/43998] inline assembler: can't set clobbering for input register

2013-04-08 Thread ilya.lesokhin at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43998 Ilya Lesokhin ilya.lesokhin at gmail dot com changed: What|Removed |Added CC|

[Bug inline-asm/43998] inline assembler: can't set clobbering for input register

2010-05-14 Thread socketpair at gmail dot com
--- Comment #11 from socketpair at gmail dot com 2010-05-14 06:31 --- Suppose this: volatile int x; asm(something::a (1)) x=1; the compiler may think that something do not modify eax. So next assignment may use eax ( mov eax, x ). So, it does not make sense to have it as a clobber is

[Bug inline-asm/43998] inline assembler: can't set clobbering for input register

2010-05-14 Thread ebotcazou at gcc dot gnu dot org
--- Comment #12 from ebotcazou at gcc dot gnu dot org 2010-05-14 07:10 --- the compiler may think that something do not modify eax. So next assignment may use eax ( mov eax, x ). So, it does not make sense to have it as a clobber is not correct. does not it ? Andrew was saying that

[Bug inline-asm/43998] inline assembler: can't set clobbering for input register

2010-05-13 Thread pinskia at gcc dot gnu dot org
--- Comment #10 from pinskia at gcc dot gnu dot org 2010-05-14 02:44 --- Because the way the constraints are implemented inside GCC, an input constraint cannot overlap with a clobber. As input constraint can stay in the same register across the inline-asm so it does not make sense to

[Bug inline-asm/43998] inline assembler: can't set clobbering for input register

2010-05-06 Thread ubizjak at gmail dot com
--- Comment #1 from ubizjak at gmail dot com 2010-05-06 07:11 --- You can use cpuid.h. BTW: Please ask questions about using gcc in gcc-help@ or elsewhere. Not a bug. -- ubizjak at gmail dot com changed: What|Removed |Added

[Bug inline-asm/43998] inline assembler: can't set clobbering for input register

2010-05-06 Thread jakub at gcc dot gnu dot org
--- Comment #2 from jakub at gcc dot gnu dot org 2010-05-06 08:06 --- To answer the exact question, yes, using a dummy variable as output (perhaps with 1 instead of a for the matching input) is the right fix. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43998

[Bug inline-asm/43998] inline assembler: can't set clobbering for input register

2010-05-06 Thread socketpair at gmail dot com
--- Comment #3 from socketpair at gmail dot com 2010-05-06 11:00 --- Thanks alot, but I think it is bug in gcc inline assembler. I think I wrote correct asm() line. I know about cpuid.h I listed this instruction just as example. -- socketpair at gmail dot com changed:

[Bug inline-asm/43998] inline assembler: can't set clobbering for input register

2010-05-06 Thread rguenth at gcc dot gnu dot org
--- Comment #4 from rguenth at gcc dot gnu dot org 2010-05-06 11:31 --- You can't at the same time force something into aregs and clobber them. -- rguenth at gcc dot gnu dot org changed: What|Removed |Added

[Bug inline-asm/43998] inline assembler: can't set clobbering for input register

2010-05-06 Thread socketpair at gmail dot com
--- Comment #5 from socketpair at gmail dot com 2010-05-06 11:41 --- Well, how to say that to compiler: This instruction receives input in register eax, but after executing it, eax value will be corrupted. I don't need this new value, but compiler should not think that eax is

[Bug inline-asm/43998] inline assembler: can't set clobbering for input register

2010-05-06 Thread hjl dot tools at gmail dot com
--- Comment #6 from hjl dot tools at gmail dot com 2010-05-06 13:09 --- (In reply to comment #5) Well, how to say that to compiler: This instruction receives input in register eax, but after executing it, eax value will be corrupted. I don't need this new value, but compiler

[Bug inline-asm/43998] inline assembler: can't set clobbering for input register

2010-05-06 Thread socketpair at gmail dot com
--- Comment #7 from socketpair at gmail dot com 2010-05-06 13:42 --- Just make eax both input and output. it's not optimal. gcc will try to preserve new eax value. So it will not use eax register in next instructions. If eax is really need, it will save it in esi, edi or so on - it's

[Bug inline-asm/43998] inline assembler: can't set clobbering for input register

2010-05-06 Thread rguenth at gcc dot gnu dot org
--- Comment #8 from rguenth at gcc dot gnu dot org 2010-05-06 13:55 --- (In reply to comment #7) Just make eax both input and output. it's not optimal. gcc will try to preserve new eax value. So it will not use eax register in next instructions. If eax is really need, it will save

[Bug inline-asm/43998] inline assembler: can't set clobbering for input register

2010-05-06 Thread socketpair at gmail dot com
--- Comment #9 from socketpair at gmail dot com 2010-05-06 15:03 --- Not if you make the output unused by not using it. I do not understand why gcc distinguish between 'specifying register as output' and 'specifying as clobbering'. I always considered, that 'clobber list' specify list