On Wed, Jun 29, 2005 at 03:40:11AM -0400, Paul Schlie wrote:
> > Since you made an incorrect analysis, you draw incorrect conclusions.
> 
> - fair enough, however it seems to me that assuming overflow does not occur
> and assuming overflows are trapped are logically equivalent?

No.  Assuming overflows are trapped puts an unnecessary constraint on the
compiler.  It prevents treating integer arithmetic as associative, for
example (as that might introduce a new trap).

> Overall, I guess I still simply believe the the first rule of optimization
> is to preserve existing semantics unless explicitly authorized otherwise,
> and then only if accompanied with corresponding warnings for all potentially
> behavior altering assumptions applied.

But C does not define the semantics of integer overflow, so there are no
existing semantics to preserve.





Reply via email to