[Bug target/23909] Incorrect code generated for SSE2 based xor routine when compiled with -O2 -fomit-frame-pointer
jeff at panasas dot com
gcc-bugzilla@gcc.gnu.org
Fri Sep 16 14:50:00 GMT 2005
------- Additional Comments From jeff at panasas dot com 2005-09-16 14:50 -------
(In reply to comment #3)
> This works for me with 4.1.0 but I really think it is just an accident.
> /*@unused@*/ int cr0; /* really, it's used, but lclint doesn't "get"
__asm__ */
> This comment does not make sense.
> Specificly since GCC also warns about it:
> t.c:110: warning: unused variable Âcr0Â
> t.c:109: warning: unused variable Âreg_storeÂ
> I still think you are making a mistake in your code by using inline-asm.
I pulled out some of the code required in the kernel. When using SSE in the
kernel you have to save and restore cr0 but you can't do that at userlevel.
The comment only refers to lclint, a tool that we use to statically check our
code. lclint doesn't parse the inline asm, so we have to annotate the code.
reg_store is also another local that is used to save and restore the xmm
registers when running in the kernel. you can just ignore this at user-level.
I'm not sure why SSE intrinsics will help here? This bug is will "go-away"
when even very small changes are made to that loop, so just about any change
will mask the bug.
The other problem that we have is that this code is compiled with several
versions of gcc (2.95.2 -> 3.4) so the inline asm is a good common
denominator. I'd be willing to move to intrinisics if it solved the problem
rather than masked it. Are there other reasons that the inline asm is a bad
idea? I believe the code is completely legal inline asm.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23909
More information about the Gcc-bugs
mailing list