https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91249
Bug ID: 91249 Summary: Missed optimization: division and multiplying ops in ffast-math mode Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- For this code: float foo(float x, float y) { return x * y/y; } gcc(trunk,9,8,7,6,5) with '-O3 -ffast-math' produces this: foo(float, float): mulss xmm0, xmm1 divss xmm0, xmm1 ret clang(trunk) with '-O3 -ffast-math' produces this: foo(float, float): # @foo(float, float) ret Notes: playground on godbolt - https://godbolt.org/z/Qjr3OD