[PATCH] Outwit compiler dead code elimination in break.exp test

Fred Fish fnf@public.ninemoons.com
Mon Dec 1 18:10:00 GMT 2003


> I know that GCC will now, when -O is specified, inline (and thence 
> eliminate) pure functions.  However, I don't think that should occure 
> when -O isn't specified.

It doesn't.  The gdb specifically uses optimization for the test that
is currently failing:

  FAIL: gdb.base/break.exp: run until breakpoint set at small function, optimized file

> As for stopping GCC from eliminating code - last time this came up (ref 
> store.exp) it was recommended that the .c files be split so that GCC 
> couldn't see the potential optimization.

If that is the prefered solution, I can rework the patch.

-Fred



More information about the Gdb-patches mailing list