[PATCH][4.3] Deprecate -ftrapv

Paolo Bonzini bonzini@gnu.org
Sat Mar 1 14:25:00 GMT 2008


> I missed once point noticed by Joseph also, that the libgcc implementation
> uses signed types in the implementation of the trapping arithmetics.
> Where we of course optimize away the overflow check, so the libgcc
> routines will never trap.  (if it does work in some cases then this
> would be a missed optimization, so sooner or later it is going to
> break more)

In theory, if -ftrapv worked properly and at the compiler level (no 
libcalls), the implementation of __addvsi3 could be just

   return a + b;

compiled with -ftrapv itself...

Paolo



More information about the Gcc mailing list