This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Change set_value_range_to_[non]null to not preserve equivs


This is a semantic change but AFAICS it shouldn't result in any 
pessimization.  The behavior of the API is non-obvious.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2018-11-12  Richard Biener  <rguenther@suse.de>

	* tree-vrp.c (set_value_range_to_nonnull): Clear equiv.
	(set_value_range_to_null): Likewise.
	* vr-values.c (vr_values::extract_range_from_comparison):
	Clear equiv for constant singleton ranges.

Index: gcc/tree-vrp.c
===================================================================
--- gcc/tree-vrp.c	(revision 266026)
+++ gcc/tree-vrp.c	(working copy)
@@ -767,7 +767,7 @@ void
 set_value_range_to_nonnull (value_range *vr, tree type)
 {
   tree zero = build_int_cst (type, 0);
-  vr->update (VR_ANTI_RANGE, zero, zero);
+  set_value_range (vr, VR_ANTI_RANGE, zero, zero, NULL);
 }
 
 
@@ -776,7 +776,7 @@ set_value_range_to_nonnull (value_range
 void
 set_value_range_to_null (value_range *vr, tree type)
 {
-  set_value_range_to_value (vr, build_int_cst (type, 0), vr->equiv ());
+  set_value_range_to_value (vr, build_int_cst (type, 0), NULL);
 }
 
 /* Return true, if VAL1 and VAL2 are equal values for VRP purposes.  */
Index: gcc/vr-values.c
===================================================================
--- gcc/vr-values.c	(revision 266026)
+++ gcc/vr-values.c	(working copy)
@@ -896,7 +896,7 @@ vr_values::extract_range_from_comparison
 	 type.  */
       val = fold_convert (type, val);
       if (is_gimple_min_invariant (val))
-	set_value_range_to_value (vr, val, vr->equiv ());
+	set_value_range_to_value (vr, val, NULL);
       else
 	vr->update (VR_RANGE, val, val);
     }
@@ -1672,7 +1672,7 @@ vr_values::adjust_range_with_scev (value
   /* Like in PR19590, scev can return a constant function.  */
   if (is_gimple_min_invariant (chrec))
     {
-      set_value_range_to_value (vr, chrec, vr->equiv ());
+      set_value_range_to_value (vr, chrec, NULL);
       return;
     }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]