Skip to content

clang can't optimize calls to nexttoward() #74368

@nico

Description

@nico
% cat test.cc
#include <math.h>
int main() {
    float f = nexttoward(1.0, 0.0);
    return f;
}
% out/gn/bin/clang -c test.cc -O2 -S -o - | grep nexttow
	bl	_nexttoward

Expected: No call to nexttoward
Actual: Call

gcc can optimize it: https://godbolt.org/z/1jPbcfbxx

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions