public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "su at cs dot ucdavis.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/61741] wrong code by LTO on x86_64-linux-gnu
Date: Tue, 08 Jul 2014 05:36:00 -0000 [thread overview]
Message-ID: <bug-61741-4-8CrPaMEO5S@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61741-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61741
--- Comment #2 from Zhendong Su <su at cs dot ucdavis.edu> ---
(In reply to Andi Kleen from comment #1)
> char c = 0;
> for (; a; a--)
> for (; c >= 0; c++);
>
> Don't you rely on signed overflow which is undefined?
No, there is no signed overflow since the variable c is a char so the
increments are performed on int first and then cast back to char: (char) ((int)
c + 1).
The same also holds for short.
next prev parent reply other threads:[~2014-07-08 5:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-08 3:49 [Bug lto/61741] New: " su at cs dot ucdavis.edu
2014-07-08 5:18 ` [Bug lto/61741] " andi-gcc at firstfloor dot org
2014-07-08 5:36 ` su at cs dot ucdavis.edu [this message]
2014-07-08 9:19 ` rguenth at gcc dot gnu.org
2014-07-09 12:06 ` rguenth at gcc dot gnu.org
2014-07-09 17:15 ` [Bug c/61741] " rguenth at gcc dot gnu.org
2014-07-09 17:15 ` rguenth at gcc dot gnu.org
2014-07-10 12:21 ` [Bug c/61741] wrong code with -fno-strict-overflow rguenth at gcc dot gnu.org
2014-07-17 7:58 ` rguenth at gcc dot gnu.org
2014-07-17 7:58 ` rguenth at gcc dot gnu.org
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-61741-4-8CrPaMEO5S@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).