This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/46899] compiler optimization


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]