This is the mail archive of the
mailing list for the GCC project.
- From: "Sam Lauber" <sam124 at operamail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Sat, 29 Jan 2005 03:02:45 +0100
- Subject: New option?
I think an option -ftrapping-integer-math should be added
to GCC that generates calls to the libgcc functions
__XXXvdiX and ___XXXvsiX that call `abort()' for overflow
instead of calls to the regular assembly instructions for
that task. I.e. on x86, to add ebx + ebx into eax, instead
addl %ebx, %ebx
movl %ebx, %eax
it would do
That would create runtime overhead for normal programs, and
a *lot* of runtime overhead for alogrithms but it would
prevent overflow from causing unpredictable results
(-finline-libgcc-functions anyone ;-). But considering
that most programs (and even most alogrithms) use a fair
amount of constants, constant folding will reduce that
Web-based SMS services available at http://www.operamail.com.
From your mailbox to local or overseas cell phones.
Powered by Outblaze