diff mbox

[wide-int] Resolve merge conflicts.

Message ID AD5FB286-1D02-40A9-ADA0-08C2BB0A8E51@comcast.net
State New
Headers show

Commit Message

Mike Stump Dec. 16, 2013, 11:27 p.m. UTC
Here are some soft merge conflict resolutions….

Ok?
diff mbox

Patch

Index: ChangeLog.wide-int
===================================================================
--- ChangeLog.wide-int	(revision 206027)
+++ ChangeLog.wide-int	(working copy)
@@ -340,6 +340,9 @@ 
 	* hooks.c
 	(hook_bool_dint_dint_uint_bool_true): Removed.
 	(hook_bool_wint_wint_uint_bool_true): New.
+	* internal-fn.c
+	(ubsan_expand_si_overflow_addsub_check): Use wide-int interfaces.
+	(ubsan_expand_si_overflow_mul_check): Likewise.
 	* ipa-devirt.c
 	(get_polymorphic_call_info): Use wide-int interfaces.
 	* ipa-prop.c
Index: internal-fn.c
===================================================================
--- internal-fn.c	(revision 206028)
+++ internal-fn.c	(working copy)
@@ -237,12 +237,12 @@  ubsan_expand_si_overflow_addsub_check (t
 	;
       else if (TREE_CODE (arg0) == SSA_NAME)
 	{
-	  double_int arg0_min, arg0_max;
+	  wide_int arg0_min, arg0_max;
 	  if (get_range_info (arg0, &arg0_min, &arg0_max) == VR_RANGE)
 	    {
-	      if (!arg0_min.is_negative ())
+	      if (!wi::neg_p (arg0_min, TYPE_SIGN (TREE_TYPE (arg0))))
 		pos_neg = 1;
-	      else if (arg0_max.is_negative ())
+	      else if (wi::neg_p (arg0_max, TYPE_SIGN (TREE_TYPE (arg0))))
 		pos_neg = 2;
 	    }
 	  if (pos_neg != 3)
@@ -254,12 +254,12 @@  ubsan_expand_si_overflow_addsub_check (t
 	}
       if (pos_neg == 3 && !CONST_INT_P (op1) && TREE_CODE (arg1) == SSA_NAME)
 	{
-	  double_int arg1_min, arg1_max;
+	  wide_int arg1_min, arg1_max;
 	  if (get_range_info (arg1, &arg1_min, &arg1_max) == VR_RANGE)
 	    {
-	      if (!arg1_min.is_negative ())
+	      if (!wi::neg_p (arg1_min, TYPE_SIGN (TREE_TYPE (arg1))))
 		pos_neg = 1;
-	      else if (arg1_max.is_negative ())
+	      else if (wi::neg_p (arg1_max, TYPE_SIGN (TREE_TYPE (arg1))))
 		pos_neg = 2;
 	    }
 	}
@@ -508,37 +508,37 @@  ubsan_expand_si_overflow_mul_check (gimp
 
 	  if (TREE_CODE (arg0) == SSA_NAME)
 	    {
-	      double_int arg0_min, arg0_max;
+	      wide_int arg0_min, arg0_max;
 	      if (get_range_info (arg0, &arg0_min, &arg0_max) == VR_RANGE)
 		{
-		  if (arg0_max.sle (double_int::max_value (hprec, false))
-		      && double_int::min_value (hprec, false).sle (arg0_min))
+		  if (wi::les_p (arg0_max, wi::max_value (hprec, SIGNED))
+		      && wi::les_p (wi::min_value (hprec, SIGNED), arg0_min))
 		    op0_small_p = true;
-		  else if (arg0_max.sle (double_int::max_value (hprec, true))
-			   && (~double_int::max_value (hprec,
-						       true)).sle (arg0_min))
+		  else if (wi::les_p (arg0_max, wi::max_value (hprec, UNSIGNED))
+			   && wi::les_p (~wi::max_value (hprec, UNSIGNED),
+					 arg0_min))
 		    op0_medium_p = true;
-		  if (!arg0_min.is_negative ())
+		  if (!wi::neg_p (arg0_min, TYPE_SIGN (TREE_TYPE (arg0))))
 		    op0_sign = 0;
-		  else if (arg0_max.is_negative ())
+		  else if (wi::neg_p (arg0_max, TYPE_SIGN (TREE_TYPE (arg0))))
 		    op0_sign = -1;
 		}
 	    }
 	  if (TREE_CODE (arg1) == SSA_NAME)
 	    {
-	      double_int arg1_min, arg1_max;
+	      wide_int arg1_min, arg1_max;
 	      if (get_range_info (arg1, &arg1_min, &arg1_max) == VR_RANGE)
 		{
-		  if (arg1_max.sle (double_int::max_value (hprec, false))
-		      && double_int::min_value (hprec, false).sle (arg1_min))
+		  if (wi::les_p (arg1_max, wi::max_value (hprec, SIGNED))
+		      && wi::les_p (wi::min_value (hprec, SIGNED), arg1_min))
 		    op1_small_p = true;
-		  else if (arg1_max.sle (double_int::max_value (hprec, true))
-			   && (~double_int::max_value (hprec,
-						       true)).sle (arg1_min))
+		  else if (wi::les_p (arg1_max, wi::max_value (hprec, UNSIGNED))
+			   && wi::les_p (~wi::max_value (hprec, UNSIGNED),
+					 arg1_min))
 		    op1_medium_p = true;
-		  if (!arg1_min.is_negative ())
+		  if (!wi::neg_p (arg1_min, TYPE_SIGN (TREE_TYPE (arg1))))
 		    op1_sign = 0;
-		  else if (arg1_max.is_negative ())
+		  else if (wi::neg_p (arg1_max, TYPE_SIGN (TREE_TYPE (arg1))))
 		    op1_sign = -1;
 		}
 	    }