http://bugs.winehq.org/show_bug.cgi?id=59856 Bug ID: 59856 Summary: "musl: Use __builtin_rint if available" breaks rounding control in rint function family on x86_64 Product: Wine Version: 10.11 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvcrt Assignee: wine-bugs@list.winehq.org Reporter: martin@martin.st CC: piotr@codeweavers.com Regression SHA1: ee6e83dca874491329c5b376c2f9563093e3c69f Distribution: --- Created attachment 81156 --> http://bugs.winehq.org/attachment.cgi?id=81156 Test executable Since "musl: Use __builtin_rint if available", commit ee6e83dca874491329c5b376c2f9563093e3c69f, an x86_64 build no longer correctly handles rounding control for the rint family of functions. (Since 02f3e6ea8a67d95b800d39e32d79a625561cd7e1, "__builtin_rint" is only used in builds with GCC, not Clang. But this affects e.g. Ubuntu distribution builds of Wine on x86_64.) This can be reproduced with e.g. https://github.com/mstorsjo/llvm-mingw/blob/master/test/crt-test.c. I'm attaching a binary build of this testcase, built with MSVC with -MD. Before this commit, this executable outputs: 2905 tests, 0 failures After this commit, we instead get this output: test/crt-test.c:940: FE_DOWNWARD llrint(F(-3.3)) failed, expected -4, got -3 test/crt-test.c:940: FE_DOWNWARD llrint(F(-3.6)) failed, expected -4, got -3 test/crt-test.c:942: FE_DOWNWARD llrintl(F(-3.3)) failed, expected -4, got -3 test/crt-test.c:942: FE_DOWNWARD llrintl(F(-3.6)) failed, expected -4, got -3 test/crt-test.c:943: FE_DOWNWARD lrint(F(-3.3)) failed, expected -4, got -3 test/crt-test.c:943: FE_DOWNWARD lrint(F(-3.6)) failed, expected -4, got -3 test/crt-test.c:945: FE_DOWNWARD lrintl(F(-3.3)) failed, expected -4, got -3 test/crt-test.c:945: FE_DOWNWARD lrintl(F(-3.6)) failed, expected -4, got -3 test/crt-test.c:953: FE_DOWNWARD rint(F(-3.3)) failed, expected -4.000000, got -3.000000 test/crt-test.c:953: FE_DOWNWARD rint(F(-3.6)) failed, expected -4.000000, got -3.000000 test/crt-test.c:955: FE_DOWNWARD rintl(F(-3.3)) failed, expected -4.000000, got -3.000000 test/crt-test.c:955: FE_DOWNWARD rintl(F(-3.6)) failed, expected -4.000000, got -3.000000 test/crt-test.c:956: FE_DOWNWARD nearbyint(F(-3.3)) failed, expected -4.000000, got -3.000000 test/crt-test.c:956: FE_DOWNWARD nearbyint(F(-3.6)) failed, expected -4.000000, got -3.000000 test/crt-test.c:958: FE_DOWNWARD nearbyintl(F(-3.3)) failed, expected -4.000000, got -3.000000 test/crt-test.c:958: FE_DOWNWARD nearbyintl(F(-3.6)) failed, expected -4.000000, got -3.000000 test/crt-test.c:969: FE_UPWARD llrint(F(-3.3)) failed, expected -3, got -4 test/crt-test.c:969: FE_UPWARD llrint(F(-3.6)) failed, expected -3, got -4 test/crt-test.c:971: FE_UPWARD llrintl(F(-3.3)) failed, expected -3, got -4 test/crt-test.c:971: FE_UPWARD llrintl(F(-3.6)) failed, expected -3, got -4 test/crt-test.c:972: FE_UPWARD lrint(F(-3.3)) failed, expected -3, got -4 test/crt-test.c:972: FE_UPWARD lrint(F(-3.6)) failed, expected -3, got -4 test/crt-test.c:974: FE_UPWARD lrintl(F(-3.3)) failed, expected -3, got -4 test/crt-test.c:974: FE_UPWARD lrintl(F(-3.6)) failed, expected -3, got -4 test/crt-test.c:982: FE_UPWARD rint(F(-3.3)) failed, expected -3.000000, got -4.000000 test/crt-test.c:982: FE_UPWARD rint(F(-3.6)) failed, expected -3.000000, got -4.000000 test/crt-test.c:984: FE_UPWARD rintl(F(-3.3)) failed, expected -3.000000, got -4.000000 test/crt-test.c:984: FE_UPWARD rintl(F(-3.6)) failed, expected -3.000000, got -4.000000 test/crt-test.c:985: FE_UPWARD nearbyint(F(-3.3)) failed, expected -3.000000, got -4.000000 test/crt-test.c:985: FE_UPWARD nearbyint(F(-3.6)) failed, expected -3.000000, got -4.000000 test/crt-test.c:987: FE_UPWARD nearbyintl(F(-3.3)) failed, expected -3.000000, got -4.000000 test/crt-test.c:987: FE_UPWARD nearbyintl(F(-3.6)) failed, expected -3.000000, got -4.000000 2905 tests, 32 failures -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.