This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/82068] New: wrong double to uint64_t conversion with -mieee
- From: "coypu at sdf dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 01 Sep 2017 04:05:24 +0000
- Subject: [Bug c/82068] New: wrong double to uint64_t conversion with -mieee
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82068
Bug ID: 82068
Summary: wrong double to uint64_t conversion with -mieee
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: coypu at sdf dot org
Target Milestone: ---
background:
gcc 8.0.0 20170827
netbsd-8.99.2/alpha, 21264
the following test case asserts if built with -mieee, but not without:
#include <assert.h>
#include <inttypes.h>
#include <stdint.h>
int
main (void)
{
long double even = 9223372036854775808.000000; /* 2^63 */
uint64_t unsigned_even = even;
assert(unsigned_even % 2 == 0);
return 0;
}