[PATCH] Document arithmetic overflow semantics

Robert Dewar dewar@gnat.com
Sun Feb 16 16:17:00 GMT 2003


> 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.



More information about the Gcc mailing list