[PATCH] Document arithmetic overflow semantics
Segher Boessenkool
segher@koffie.nl
Tue Feb 18 06:41:00 GMT 2003
Robert Dewar wrote:
>>Yes, but won't such a program always give a compile-time
>>warning like "this branch will never be executed" or
>>"unreachable code deleted"? Can you give an example
>>where the compiler will delete a branch but where it
>>is not able to diagnose it did?
>
> 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.
Of course, but I can't come up with an example where the
compiler can't easily warn "unreachable code deleted".
Can you?
Segher
More information about the Gcc
mailing list