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

Reply via email to