aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sccvn.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-01-25 09:05:47 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-01-25 09:05:47 +0000
commitfa4511c2f4d3bacf5e9d5cc5907d3812204928bb (patch)
tree56be12da035518715f8b8e86bbdfcc9e23eb4259 /gcc/tree-ssa-sccvn.c
parent7ff1503c731680d9c4917f1ecb5ef7df20b7feb2 (diff)
downloadgcc-fa4511c2f4d3bacf5e9d5cc5907d3812204928bb.zip
gcc-fa4511c2f4d3bacf5e9d5cc5907d3812204928bb.tar.gz
gcc-fa4511c2f4d3bacf5e9d5cc5907d3812204928bb.tar.bz2
re PR tree-optimization/69376 (wrong code at -Os and above on x86_64-linux-gnu)
2016-01-25 Richard Biener <rguenther@suse.de> PR tree-optimization/69376 * tree-ssa-sccvn.h (struct vn_ssa_aux): Add range_info_anti_range_p flag. (VN_INFO_ANTI_RANGE_P): New inline. (VN_INFO_RANGE_TYPE): Likewise. * tree-ssa-sccvn.c (set_ssa_val_to): Also record and copy SSA_NAME_ANTI_RANGE_P. (free_scc_vn): Restore SSA_NAME_ANTI_RANGE_P. * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children): Properly query VN_INFO_RANGE_TYPE. * gcc.dg/torture/pr69376.c: New testcase. From-SVN: r232786
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r--gcc/tree-ssa-sccvn.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index b42525f..726294e 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -3139,15 +3139,24 @@ set_ssa_val_to (tree from, tree to)
{
/* Save old info. */
if (! VN_INFO (to)->info.range_info)
- VN_INFO (to)->info.range_info = SSA_NAME_RANGE_INFO (to);
+ {
+ VN_INFO (to)->info.range_info = SSA_NAME_RANGE_INFO (to);
+ VN_INFO (to)->range_info_anti_range_p
+ = SSA_NAME_ANTI_RANGE_P (to);
+ }
/* Use that from the dominator. */
SSA_NAME_RANGE_INFO (to) = SSA_NAME_RANGE_INFO (from);
+ SSA_NAME_ANTI_RANGE_P (to) = SSA_NAME_ANTI_RANGE_P (from);
}
else
{
/* Save old info. */
if (! VN_INFO (to)->info.range_info)
- VN_INFO (to)->info.range_info = SSA_NAME_RANGE_INFO (to);
+ {
+ VN_INFO (to)->info.range_info = SSA_NAME_RANGE_INFO (to);
+ VN_INFO (to)->range_info_anti_range_p
+ = SSA_NAME_ANTI_RANGE_P (to);
+ }
/* Rather than allocating memory and unioning the info
just clear it. */
SSA_NAME_RANGE_INFO (to) = NULL;
@@ -4313,7 +4322,11 @@ free_scc_vn (void)
SSA_NAME_PTR_INFO (name) = VN_INFO (name)->info.ptr_info;
else if (INTEGRAL_TYPE_P (TREE_TYPE (name))
&& VN_INFO (name)->info.range_info)
- SSA_NAME_RANGE_INFO (name) = VN_INFO (name)->info.range_info;
+ {
+ SSA_NAME_RANGE_INFO (name) = VN_INFO (name)->info.range_info;
+ SSA_NAME_ANTI_RANGE_P (name)
+ = VN_INFO (name)->range_info_anti_range_p;
+ }
}
}
obstack_free (&vn_ssa_aux_obstack, NULL);