This is the mail archive of the gcc-patches@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: [PATCH] Document arithmetic overflow semantics


> > Actually it is often very difficult to track down actions in a complex
> > optimization circuit that is manipulating some intermediate form to give
> > clear diagnostics, because the sequence of logic that arrives at a decision
> > may be arbitrarily complex, and it may be difficult for instance o tell
> > if the code in question is a direct consequence of the original source
> > code, or some code generated by some other optimization. Certainly there
> > is no requirement for a compiler to give such warnings.
 
On Tue, Feb 18, 2003 at 05:36:32AM +0100, Segher Boessenkool wrote:
> Of course, but I can't come up with an example where the
> compiler can't easily warn "unreachable code deleted".
> Can you?

I commonly write C++ templates that rely on constant folding for optimization.
The fact that unreachable code is deleted is a feature, not a bug, and any
compiler that insisted on warning me every time unreachable code is deleted
would be rejected as unusable.

Neverthess, redundant code is sometimes an indication that something is
wrong, but only when the code is redundant at source level when the values
of macros or the form of expanded templates is considered opaque.  There's
a discussion of this in some of Dawson Engler's metacompilation papers.


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