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

Shankar <shankarke@gmail.com>
Fri, 1 Apr 2011 15:31:09 -0700 (PDT)

          From comp.compilers

Related articles
[5 earlier articles]
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: Shankar <shankarke@gmail.com>
Newsgroups: comp.compilers
Date: Fri, 1 Apr 2011 15:31:09 -0700 (PDT)
Organization: Compilers Central
References: 11-03-054 11-03-061 11-03-063
Keywords: GCC, debug, optimize
Posted-Date: 02 Apr 2011 19:46:09 EDT

On Mar 29, 2:42 pm, i...@localhost.claranet.nl (Ike Naar) wrote:
> George Neuner <gneun...@comcast.net> wrote:
>
> >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.
>
> Sometimes using -O3 makes the program run slower than when using -O2.


I think you should use some tool like valgrind which might immediately
catch the problem that would be going on.


Also when you use -ggdb I think some of the strings are loaded in
the .data section but gets loaded into the .const data section
otherwise.


-


Shankar



Post a followup to this message

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