This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -funsafe-loop-optimizations
Kai Henningsen wrote:
1. Assert somehow which calculations are/aren't supposed to overflow/wrap
(where I care)
2. Option A, have the compiler insert checking code to make sure, at
runtime, that what I asserted actually holds
3. Option B, have the compiler rely on my assertions for optimal
optimization
4. While I don't see an obvious use, presumably someone will also want
option C, ignore my assertions.
And yes, I know where to find Pascal ;-)
You will do even better with Ada, which has all the above capabilities
and more :-)
The trouble with trying to do this in C is that it is really a
substantial language capability that you are trying to bolt on, and
it is hard to do that cleanly if it is not in the original language
design.