From: "Kevin P. Fleming" <kpfleming@digium.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: List of optimizations enabled by -O1 seems incorrect
Date: Thu, 13 Aug 2009 22:01:00 -0000 [thread overview]
Message-ID: <4A84751C.2040304@digium.com> (raw)
In-Reply-To: <4A847100.1010108@redhat.com>
Andrew Haley wrote:
> Kevin P. Fleming wrote:
>> Nikos Chantziaras wrote:
>>
>>> Thanks for the tip. Looking at the generated assembly files, I finally
>>> solved the "mystery": GCC uses SSE/SSE2 instructions to fetch both
>>> variables in one CPU instruction. It's faster but circumvents
>>> short-circuit "if" rules and Valgrind prints an error.
>> Then that seems very broken; you should not have to have initialized a
>> variable to avoid this issue, since short-circuit evaluation is defined
>> in the C standard.
>
> Yes, but it's covered by the "as if" rule: if no conforming program could
> ever notice the difference, an optimization is allowed.
Well, I guess that was my point, stated in another way. I'm certainly no
C standard expert, but I didn't think his program was 'non-conforming'
in any way.
--
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kpfleming@digium.com
Check us out at www.digium.com & www.asterisk.org
next prev parent reply other threads:[~2009-08-13 20:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-13 18:25 Nikos Chantziaras
2009-08-13 19:02 ` Andrew Haley
2009-08-13 20:15 ` Nikos Chantziaras
2009-08-13 20:18 ` Kevin P. Fleming
2009-08-13 20:56 ` Andrew Haley
2009-08-13 22:01 ` Kevin P. Fleming [this message]
2009-08-14 10:53 ` Ian Lance Taylor
2009-08-14 14:22 ` Kevin P. Fleming
2009-08-14 16:58 ` Andrew Haley
2009-08-14 18:23 ` Kevin P. Fleming
2009-08-13 21:36 ` Nikos Chantziaras
2009-08-13 19:38 ` John (Eljay) Love-Jensen
2009-08-14 18:51 Bill McEnaney
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=4A84751C.2040304@digium.com \
--to=kpfleming@digium.com \
--cc=gcc-help@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).