public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "eskil at obsession dot se" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/46899] compiler optimization
Date: Sun, 12 Dec 2010 22:23:00 -0000	[thread overview]
Message-ID: <bug-46899-4-sYuadJu8DD@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-46899-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46899

--- Comment #9 from Eskil Steenberg <eskil at obsession dot se> 2010-12-12 22:23:36 UTC ---
Hi

> No, it is possible because the value is undefined so both the if being
> false and the printout happening can happen.

But undefined still means that the variable c has a value, just not
something that cant be determined at compile time.

The value c is not undefined, just the operation that produces the value
stored in c. Therefor anything the variable c touches shouldn't become
undefined too.

If i give someone the number 9 and tell them to do a square root of it,
they should produce a 3 even if I dont define where I got the number 9. if
they go ahead and produce the value 4, I'm going to say that they are
wrong, and not buy the argument "Since you dont define where you got the
number, I'm going to assume you really meent 16 and not 9".

I really dislike the idea that something can be undefined, and at the same
time the compiler can make assumptions about what it can be. pick one.

Cheers

E


  parent reply	other threads:[~2010-12-12 22:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-12  0:35 [Bug c/46899] New: " eskil at obsession dot se
2010-12-12  1:54 ` [Bug c/46899] " pinskia at gcc dot gnu.org
2010-12-12  1:56 ` pinskia at gcc dot gnu.org
2010-12-12  9:10 ` eskil at obsession dot se
2010-12-12 10:20 ` pinskia at gcc dot gnu.org
2010-12-12 12:30 ` eskil at obsession dot se
2010-12-12 21:03 ` pinskia at gcc dot gnu.org
2010-12-12 21:46 ` eskil at obsession dot se
2010-12-12 21:52 ` pinskia at gcc dot gnu.org
2010-12-12 22:23 ` eskil at obsession dot se [this message]
2010-12-13  0:21 ` schwab@linux-m68k.org
2010-12-13 14:09 ` eskil at obsession dot se

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-46899-4-sYuadJu8DD@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).