https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84996
Bug ID: 84996 Summary: Adding or substracting 0.0 could be optimized away even without -ffast-math Product: gcc Version: 8.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- The code float test(float lhs) { return lhs + 0.0; } generates suboptimal assembly test(float): addss xmm0, DWORD PTR .LC0[rip] ret .LC0: .long 0 Optimal assembly would be test(float): # @test(float) ret