aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-stdarg.c
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2020-12-22 18:13:24 +0100
committerUros Bizjak <ubizjak@gmail.com>2020-12-22 18:14:51 +0100
commit337ed0eb490b14899f4049bc4c8922eb1d8a2e67 (patch)
treecd68fc8e6ed92d585b4baa8b6c3f898d0c6d0c58 /gcc/tree-stdarg.c
parent7e63d383b89cd75b7775883d71ed09724b9ee73f (diff)
downloadgcc-337ed0eb490b14899f4049bc4c8922eb1d8a2e67.zip
gcc-337ed0eb490b14899f4049bc4c8922eb1d8a2e67.tar.gz
gcc-337ed0eb490b14899f4049bc4c8922eb1d8a2e67.tar.bz2
i386: Fix __builtin_floor with FE_DOWNWARD rounding direction [PR96793]
x86_expand_floorceil expander uses x86_sse_copysign_to_positive, which is unable to change the sign from - to +. When FE_DOWNWARD rounding direction is in effect, the expanded sequence that involves subtraction can trigger x - x = -0.0 special rule. x86_sse_copysign_to_positive fails to change the sign of the intermediate value, assumed to always be positive, back to positive. The patch adds one extra fabs that strips the sign from the intermediate value when flag_rounding_math is in effect. 2020-12-22 Uroš Bizjak <ubizjak@gmail.com> gcc/ PR target/96793 * config/i386/i386-expand.c (ix86_expand_floorceil): Remove the sign of the intermediate value for flag_rounding_math. (ix86_expand_floorceildf_32): Ditto. gcc/testsuite/ PR target/96793 * gcc.target/i386/pr96793.c: New test.
Diffstat (limited to 'gcc/tree-stdarg.c')
0 files changed, 0 insertions, 0 deletions