[PATCH] Document arithmetic overflow semantics
Richard Kenner
kenner@vlsi1.ultra.nyu.edu
Thu Feb 13 16:21:00 GMT 2003
At the GCC internal level there should be no such thing as undefined
behaviour, this is a front-end concept.
I disagree. As I said, it's quite valuable to be able to know that we
don't care, for optimization purposes, if an overflow has or has
not occurred.
As for trap on overflow, that is currently supported and honored in
the middle-end, by flag_trapv and flag_non_call_exceptions.
I'm talking about *per expression*.
You may have noticed that my original patch, was a simple
documentation patch that just described what GCC currently does, and
what is assumed at several points in the code.
Nope. Lots of places in the optimizer assume that overflow signed
integers are undefined. Your proposed documentation doesn't mention that.
More information about the Gcc
mailing list