This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: dead code identification
- From: Matthew Woehlke <mw_triad at users dot sourceforge dot net>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 13 Feb 2008 10:26:42 -0600
- Subject: Re: dead code identification
- References: <200802120850.22606.mark.hampton@certess.com>
Mark Hampton wrote:
I would like to identify dead/redundant code that is being optimized away by
gcc. Is there a way to have gcc report the line number associated with this
code ?
I guess someone should point out that some commercial compilers (Sun's
comes to mind) issue warnings for unreachable code. IMO this would make
a nice improvement to gcc.
As far as redundant code, though, redundant code can be more readable
than the alternative (I've several times caught myself writing redundant
code and hoping gcc would fold it in optimization).
--
Matthew
"It's ok, I forgive you. I often confuse cream cheese with happiness
myself ;-)" -- Jeremy Whiting (responding to a rather strange yet
amusing conversation I'd started; also, I agree with the sentiment)