]> git.ipfire.org Git - thirdparty/gcc.git/commit
middle-end/84407 - honor -frounding-math for int to float conversion
authorRichard Biener <rguenther@suse.de>
Thu, 28 Oct 2021 09:38:32 +0000 (11:38 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 28 Oct 2021 13:45:22 +0000 (15:45 +0200)
commit81342e95827f77c0917dd7a9fd54ac9729439c8e
tree2e1dd82b395637f69ac307d1e0414a778aaef6d0
parent113dab2b9d511f3aadc30a6a921fc30bd5f93706
middle-end/84407 - honor -frounding-math for int to float conversion

This makes us honor -frounding-math for integer to float conversions
and avoid constant folding when such conversion is not exact.

2021-10-28  Richard Biener  <rguenther@suse.de>

PR middle-end/84407
* fold-const.c (fold_convert_const): Avoid int to float
constant folding with -frounding-math and inexact result.
* simplify-rtx.c (simplify_const_unary_operation): Likewise
for both float and unsigned_float.

* gcc.dg/torture/fp-uint64-convert-double-1.c: New testcase.
* gcc.dg/torture/fp-uint64-convert-double-2.c: Likewise.
gcc/fold-const.c
gcc/simplify-rtx.c
gcc/testsuite/gcc.dg/torture/fp-uint64-convert-double-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/torture/fp-uint64-convert-double-2.c [new file with mode: 0644]