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/34841] 'make check' of libsndfile-1.0.17 fails with gcc-4.2.2 -O2 optimization, OK with -O1 one



------- 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


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