This may even work for -funsafe-math-optimizations only (we round differently). One has to enumerate all interesting cases (mainly x == 0) and see if NaN/Inf are properly preserved in all cases.
-- Summary: Fold 1.0/sqrt(x/y) to sqrt(y/x) Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rguenth at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32279