This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/34841] 'make check' of libsndfile-1.0.17 fails with gcc-4.2.2 -O2 optimization, OK with -O1 one
- From: "sergstesh at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jan 2008 03:20:40 -0000
- Subject: [Bug c/34841] 'make check' of libsndfile-1.0.17 fails with gcc-4.2.2 -O2 optimization, OK with -O1 one
- References: <bug-34841-13529@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #12 from sergstesh at yahoo dot com 2008-01-18 03:20 -------
Regarding
"
About the dependency on optimization level, signed integer overflow is
undefined in C standard so its not a good idea to depend on it. What GCC does
is exploiting this fact for optimizations which is fine.
"
- I do not think this is fine. As end user I want to see my errors the same
way at any optimization level.
My expectations are that regardless of optimization level I'll get my program
functioning the same way, but with different memory consumption/speed.
I am not talking about out of bounds indices and possible reshuffling of
variables in memory, I'm talking about arithmetic/logic expressions, i.e.
printf("some_var=%g\n", some_var);
should always print the same.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34841