NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
lib/53027: macro renaming of functions discourages optimization
>Number: 53027
>Category: lib
>Synopsis: macro renaming of functions discourages optimization
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: lib-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Feb 14 12:35:00 +0000 2018
>Originator: coypu
>Release: NetBSD 8.99.12
>Organization:
>Environment:
NetBSD planets 8.99.12 NetBSD 8.99.12 (GENERIC) #0: Thu Feb 8 00:38:03 IST 2018 fly@planets:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
These two files generate different code in netbsd if compiled with:
gcc -O3 test.c -shared -fPIC
-----------------------------------------------------------------------
With header (#define isnan __isnan ..)
#include <math.h>
int dummy(float x) { return isnan(x); }
00000000000004ec <dummy>:
4ec: e9 0f ff ff ff jmpq 400 <__isnanf@plt>
-----------------------------------------------------------------------
Without the header
int dummy(float x) { return isnan(x); }
000000000000049c <dummy>:
49c: 31 c0 xor %eax,%eax
49e: 0f 2e c0 ucomiss %xmm0,%xmm0
4a1: 0f 9a c0 setp %al
4a4: c3 retq
it is replaced by builtin.
>How-To-Repeat:
>Fix:
Home |
Main Index |
Thread Index |
Old Index