diff options
author | Richard Biener <rguenther@suse.de> | 2019-09-11 08:22:51 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2019-09-11 08:22:51 +0000 |
commit | dc5b11916a2e318bd15d60f6cfd01d1e306ffbfb (patch) | |
tree | dd0d5d06c0d4a33dc39c300327569ab15d817659 /gcc/match.pd | |
parent | 3d34b7afaeeb9422493873041c2aa14474eac129 (diff) | |
download | gcc-dc5b11916a2e318bd15d60f6cfd01d1e306ffbfb.zip gcc-dc5b11916a2e318bd15d60f6cfd01d1e306ffbfb.tar.gz gcc-dc5b11916a2e318bd15d60f6cfd01d1e306ffbfb.tar.bz2 |
revert: match.pd: Add flag_unsafe_math_optimizations check before deciding on the widest type in...
2019-09-11 Richard Biener <rguenther@suse.de>
Revert
2019-09-09 Barnaby Wilks <barnaby.wilks@arm.com>
* match.pd: Add flag_unsafe_math_optimizations check
before deciding on the widest type in a binary math operation.
* gcc.dg/fold-binary-math-casts.c: New test.
From-SVN: r275632
Diffstat (limited to 'gcc/match.pd')
-rw-r--r-- | gcc/match.pd | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/gcc/match.pd b/gcc/match.pd index 309a094..05009bb 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -5056,18 +5056,10 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) && newtype == type && types_match (newtype, type)) (op (convert:newtype @1) (convert:newtype @2)) - (with - { - if (!flag_unsafe_math_optimizations) - { - if (TYPE_PRECISION (ty1) > TYPE_PRECISION (newtype)) + (with { if (TYPE_PRECISION (ty1) > TYPE_PRECISION (newtype)) newtype = ty1; - if (TYPE_PRECISION (ty2) > TYPE_PRECISION (newtype)) - newtype = ty2; - } - } - + newtype = ty2; } /* Sometimes this transformation is safe (cannot change results through affecting double rounding cases) and sometimes it is not. If NEWTYPE is |