This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug math/20787] New: float_t is defined as float incorrectly on x86_64 even if __FLT_EVAL_METHOD__ is 2


https://sourceware.org/bugzilla/show_bug.cgi?id=20787

            Bug ID: 20787
           Summary: float_t is defined as float incorrectly on x86_64 even
                    if __FLT_EVAL_METHOD__ is 2
           Product: glibc
           Version: 2.24
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: kariya_mitsuru at hotmail dot com
  Target Milestone: ---

float_t is defined as float incorrectly on x86_64 even if __FLT_EVAL_METHOD__
is 2.

cf. https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86/bits/mathdef.h

At line 25, __FLT_EVAL_METHOD__ is ignored if __x86_64__ is defined.

On my test environment(Ubuntu 16.10 x86_64, gcc 6.2, glibc 2.24), the GCC
accepts option '-mfpmath=387' and so __FLT_EVAL_METHOD__ is defined as 2.


==== test code (test.c) ====
#include <stdio.h>
#include <math.h>

int main()
{
    printf("%d, %zu, %zu\n", __FLT_EVAL_METHOD__, sizeof(float_t),
sizeof(double_t));
}
==== test code (test.c) ====

==== output (gcc test.c && ./a.out) ====
0, 4, 8
==== output (gcc test.c && ./a.out) ====

==== output (gcc -mfpmath=387 test.c && ./a.out) ====
2, 4, 8
==== output (gcc -mfpmath=387 test.c && ./a.out) ====

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]