Re: GCC/G++ compiler: Error goes away when run through debugger

George Neuner <gneuner2@comcast.net>
Tue, 29 Mar 2011 12:18:24 -0400

          From comp.compilers

Related articles
GCC/G++ compiler: Error goes away when run through debugger rhoads@cs.rutgers.edu (rhoads@cs.rutgers.edu) (2011-03-26)
Re: GCC/G++ compiler: Error goes away when run through debugger nospam@no.spam (Mark in Sutherland) (2011-03-27)
Re: GCC/G++ compiler: Error goes away when run through debugger bobduff@shell01.TheWorld.com (Robert A Duff) (2011-03-27)
Re: GCC/G++ compiler: Error goes away when run through debugger robin51@dodo.com.au (robin) (2011-03-28)
Re: GCC/G++ compiler: Error goes away when run through debugger Pidgeot18@verizon.invalid (Joshua Cranmer) (2011-03-27)
Re: GCC/G++ compiler: Error goes away when run through debugger torbenm@diku.dk (2011-03-28)
Re: GCC/G++ compiler: Error goes away when run through debugger bc@freeuk.com (BartC) (2011-03-28)
Re: GCC/G++ compiler: Error goes away when run through debugger gneuner2@comcast.net (George Neuner) (2011-03-29)
Re: GCC/G++ compiler: Error goes away when run through debugger gah@ugcs.caltech.edu (glen herrmannsfeldt) (2011-03-29)
Re: GCC/G++ compiler: Error goes away when run through debugger ike@localhost.claranet.nl (2011-03-29)
Re: GCC/G++ compiler: Error goes away when run through debugger gneuner2@comcast.net (George Neuner) (2011-03-31)
Re: GCC/G++ compiler: Error goes away when run through debugger shankarke@gmail.com (Shankar) (2011-04-01)
| List of all articles for this month |

From: George Neuner <gneuner2@comcast.net>
Newsgroups: comp.compilers
Date: Tue, 29 Mar 2011 12:18:24 -0400
Organization: A noiseless patient Spider
References: 11-03-054
Keywords: GCC, debug
Posted-Date: 29 Mar 2011 15:14:13 EDT

On Sat, 26 Mar 2011 12:35:22 -0700 (PDT), "rhoads@cs.rutgers.edu"
<rhoads@cs.rutgers.edu> wrote:


>I'm using the gcc/g++ compiler under Cygwin (an UNIX emulator that
>runs on windows).
> :
>The -O3 optimizations are supposed to always produce the same
>results. Running through the debugger is not supposed to change the
>results either. Has anybody else encountered this behavior?


As Mark mentioned already, your problem is most likely uninitialized
variables. But that said ...


GCC's -O3 optimization level is widely known to cause strange problems
... almost always because the program is violating assumptions made by
the more advanced optimizations.


The -O2 level typically is safe. If you think you need the -O3
optimizations, you should individually enable them to see if any
breaks the program. Specify -O3 only if you find they all work.


George



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.