This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Re: dead code identification


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)



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