This is the mail archive of the gcc@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]

Re: -O0 dead code



Richard Henderson <rth@cygnus.com> writes:

> So how do people feel about the notion of dead code elimination at -O0?

We already do some dead code elimination at -O0.  It seems likely that
this would actually make compiles faster (less I/O, which is the
limiting factor at -O0). 

The only thing to worry about would be the possibility of affecting
debugging information; someone might write

int foo(int a, int b);
{
  int c;
  c = a + b;
  /* c is not used */
}

and might expect to be able to put a breakpoint on the } and examine
the value of c.  Perhaps you could do the elimination only for
non-user variables?

-- 
- Geoffrey Keating <geoffk@cygnus.com>

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