Re: gcc optimization changes results



nirnimesh wrote:

gcc optimizaton (with -O1 or -O2) is producing unexpected and wrong
results for my program. I get correct answers with no optimizations.
I'm using gcc 4.0 on FC4-x86_64. I replaced -O1 with the options it
enabls (from gcc manpage) but that doesn't trace the problem. How
should I approach to solve this problem? What should I be checking?

Not to rain on your parade, but a bug in GCC is less likely than a bug
in your application.

Your problem sounds like undefined behavior somewhere in your program.
.



Relevant Pages

  • Re: gcc optimization changes results
    ... I get correct answers with no optimizations. ... I'm using gcc 4.0 on FC4-x86_64. ... enabls but that doesn't trace the problem. ... tauno voipio iki fi ...
    (comp.os.linux.development.system)
  • Re: gcc optimization changes results
    ... I get correct answers with no optimizations. ... I'm using gcc 4.0 on FC4-x86_64. ... enabls but that doesn't trace the problem. ... Use memgrind/valgrind to check for uninitialized memory. ...
    (comp.os.linux.development.system)
  • Re: Bad performance on alpha? (make buildworld)
    ... There are a few additional optimizations which are architecture specific, ... > GCC does. ... A quick look suggests that Alpha code generation is deficient dealing with ... instructions, this simple operation requires 17 Alpha instructions!" ...
    (freebsd-performance)
  • Re: c compilation - gcc vs visual c
    ... I recently compiled a numerically intensive c project under cygwin gcc ... MS focuses a lot more on specific optimizations, ... the simplest approach, however (and the one I currently use in my compiler), ... (silly code), are ones I focus on fixing. ...
    (comp.lang.c)
  • Re: Noob Guestion About Make.conf
    ... documentation about GCC compiler options. ... Not all optimizations are controlled directly by a flag. ... CFLAGS controls the compiler settings used when compiling C ... If you expect bug reports to be taken seriously, ...
    (comp.unix.bsd.freebsd.misc)