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] PR23046


 Hi,

  This patch simply works around the ICE in vrp.  I've bootstrapped and
regtested this patch on ia64-linux.  Ok for mainline?

-- 
Thanks,
Jim

http://www.csclub.uwaterloo.ca/~ja2morri/
http://phython.blogspot.com
http://open.nit.ca/wiki/?page=jim
2005-10-08  James A. Morrison  <phython@gcc.gnu.org>

	PR tree-optimization/23046
	* tree-vrp.c (extract_range_from_assert): Avoid creating invalid
	ranges from LT_EXPR and GT_EXPR.

Index: tree-vrp.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/tree-vrp.c,v
retrieving revision 2.62
diff -u -p -r2.62 tree-vrp.c
--- tree-vrp.c	4 Oct 2005 03:02:18 -0000	2.62
+++ tree-vrp.c	8 Oct 2005 17:37:20 -0000
@@ -845,6 +845,13 @@ extract_range_from_assert (value_range_t
 	  max = limit_vr->max;
 	}
 
+      /* Avoid creating paradoxical value ranges.  */
+      if (cond_code == LT_EXPR && compare_values (min, max) == 0)
+	{
+	  set_value_range_to_varying (vr_p);
+	  return;
+	}
+
       /* For LT_EXPR, we create the range [MIN, MAX - 1].  */
       if (cond_code == LT_EXPR)
 	{
@@ -868,6 +875,13 @@ extract_range_from_assert (value_range_t
 	  min = limit_vr->min;
 	}
 
+      /* Avoid creating paradoxical value ranges.  */
+      if (cond_code == GT_EXPR && compare_values (min, max) == 0)
+	{
+	  set_value_range_to_varying (vr_p);
+	  return;
+	}
+
       /* For GT_EXPR, we create the range [MIN + 1, MAX].  */
       if (cond_code == GT_EXPR)
 	{

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