public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/57156] miscompilation of call to _mm_cmpeq_epi8(a, a) or _mm_comtrue_epu8(a, a) with uninitialized a
Date: Fri, 03 May 2013 12:27:00 -0000 [thread overview]
Message-ID: <bug-57156-4-q8RtGqlGy9@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-57156-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57156
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> 2013-05-03 12:27:05 UTC ---
(In reply to comment #5)
> (In reply to comment #4)
> > I wouldn't know how to counter this for the _mm_cmpeq_epi8 case
>
> Actually, I have yet to find something in the standard that says using an
> uninitialized __m128 is undefined behavior. ;)
> Thus the only standard that would define the rules here would be Intel's, no?
> And from reading their docs I understand that calling an intrinsics maps to the
> behavior you'd get when using the associated instruction. In this case
> comparing any XMM register with itself will result in what I expect.
The standard says that using uninitialized variables invoke undefined
behavior. That doesn't magically exclude types that are not explicitely
covered by the standard. Doing
int a;
_Bool true = a == a;
is undefined as well, so is
int a;
int zero = a ^ a;
You cannot translate optimized assembler back to C in this way.
Well, you can. Sth like
register int a asm("eax");
int zero = a ^ a;
should do it.
next prev parent reply other threads:[~2013-05-03 12:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-03 9:09 [Bug target/57156] New: " kretz at kde dot org
2013-05-03 9:10 ` [Bug target/57156] " kretz at kde dot org
2013-05-03 9:15 ` kretz at kde dot org
2013-05-03 9:16 ` pinskia at gcc dot gnu.org
2013-05-03 9:38 ` kretz at kde dot org
2013-05-03 9:56 ` kretz at kde dot org
2013-05-03 12:27 ` rguenth at gcc dot gnu.org [this message]
2013-05-03 14:13 ` [Bug tree-optimization/57156] " kretz at kde dot org
2013-07-11 9:25 ` kretz at kde dot org
2013-10-30 21:12 ` law at redhat dot com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-57156-4-q8RtGqlGy9@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).