diff options
author | sceptillion <33798691+sceptillion@users.noreply.github.com> | 2017-12-20 21:32:43 -0800 |
---|---|---|
committer | sceptillion <33798691+sceptillion@users.noreply.github.com> | 2017-12-20 21:32:43 -0800 |
commit | c9378dc2fe8e3097fee0100f2b07c2a1195dc8a0 (patch) | |
tree | 2e528788a3943f903a255aee5c9fdbd2849dc150 /gcc/real.h | |
parent | 58c860d6c48324eba66dd19540db5584d832cf58 (diff) |
fix more 64-bit float bugs
Diffstat (limited to 'gcc/real.h')
-rwxr-xr-x | gcc/real.h | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -351,10 +351,13 @@ union tree_node; REAL_VALUE_TYPE real_value_from_int_cst (union tree_node *, union tree_node *); -#define REAL_VALUE_FROM_CONST_DOUBLE(to, from) \ -do { union real_extract u; \ - memcpy((char *)&u, (char *)&CONST_DOUBLE_LOW(from), sizeof u); \ - to = u.d; } while (0) +#define REAL_VALUE_FROM_CONST_DOUBLE(to, from) \ +do { \ + union real_extract u; \ + for (int i = 0; i < sizeof (REAL_VALUE_TYPE) / sizeof (HOST_WIDE_INT); i++) \ + u.i[i] = XWINT((from), 2 + i); \ + to = u.d; \ +} while (0) /* Return a CONST_DOUBLE with value R and mode M. */ |