http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53134
Bug #: 53134 Summary: Request for option to disable excess precision on i387 Classification: Unclassified Product: gcc Version: unknown Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: bug...@aerifal.cx Would it be possible to add to gcc an option to fully disable excess floating point precision on i387? Basically it would work like this: any function performing floating point arithmetic would be responsible for reading the floating point control word, changing the precision to the right value for the nominal type of the expression being evaluated, and restoring it afterwards (before returning or making calls to any other function, to maintain compatibility with code not compiled with this option). Since even with the precision mode set correctly the exponent range of 387 fpu registers still matches that of 80-bit long double, this mode would also imply a store/load cycle after every single floating point operation, analogous to -ffloat-store but on each step of calculation, not only on assignments. I realize this would incur significant performance penalty, but for users trying to obtain exact, reproducible, floating point results correctly rounded for the type being used, it would be very useful. If the load/store cycle (stronger version of -ffloat-store) were a separate option, the performance impact would actually be extremely minimal when that part was turned off and only the precision mode setting was turned on.