aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-06-14 10:42:00 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-06-14 10:42:00 +0000
commit04976c6e075f10b80376f82a88f9450957c21cc5 (patch)
tree9a8b22c626395afad2dee14c11e900b10fdf76ec /gcc/tree-ssa.c
parent86c24ba6779658d52cef593badc7bc4902ce6702 (diff)
downloadgcc-04976c6e075f10b80376f82a88f9450957c21cc5.zip
gcc-04976c6e075f10b80376f82a88f9450957c21cc5.tar.gz
gcc-04976c6e075f10b80376f82a88f9450957c21cc5.tar.bz2
re PR tree-optimization/71522 (Wrong optimization of memcpy through a var of type long double)
2016-06-14 Richard Biener <rguenther@suse.de> PR tree-optimization/71522 * tree-ssa.c (non_rewritable_lvalue_p): Do not rewrite non-float copying into float copying. * gcc.dg/torture/pr71522.c: New testcase. From-SVN: r237429
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r--gcc/tree-ssa.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 30c6269..247fa07 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1300,6 +1300,10 @@ non_rewritable_lvalue_p (tree lhs)
|| (INTEGRAL_TYPE_P (TREE_TYPE (lhs))
&& (TYPE_PRECISION (TREE_TYPE (decl))
>= TYPE_PRECISION (TREE_TYPE (lhs)))))
+ /* Make sure we are not re-writing non-float copying into float
+ copying as that can incur normalization. */
+ && (! FLOAT_TYPE_P (TREE_TYPE (decl))
+ || types_compatible_p (TREE_TYPE (lhs), TREE_TYPE (decl)))
&& (TREE_THIS_VOLATILE (decl) == TREE_THIS_VOLATILE (lhs)))
return false;