This program: #include <stdio.h> #include <math.h> #include <fenv.h>
main() { unsigned flags; feclearexcept(FE_ALL_EXCEPT); (void)acos(1.1); flags = fetestexcept(FE_ALL_EXCEPT); printf("(void)acos( %e ) gives flags 0x%8x\n", 1.1, flags & FE_ALL_EXCEPT); } when compiled with -ftrapping-math, should show that some flags are set, FE_INVALID I think (maybe others). Instead it shows that no flags are set, because GCC has completely folded out the call to acos(). -- Summary: -ftrapping-math should prevent folding/dead code stripping of some builtins Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: geoffk at gcc dot gnu dot org GCC target triplet: *-*-darwin* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30568