]> gcc.gnu.org Git - gcc.git/commitdiff
re PR tree-optimization/26425 (ice on valid C code with flag -Os)
authorJeff Law <law@redhat.com>
Thu, 23 Feb 2006 22:47:58 +0000 (15:47 -0700)
committerJeff Law <law@gcc.gnu.org>
Thu, 23 Feb 2006 22:47:58 +0000 (15:47 -0700)
PR tree-optimization/26425
* tree-vrp.c (vrp_visit_assignment): If the LHS's type has a NULL
min/max, then assume its varying.

* gcc.c-torture/compile/pr26425.c: New test.

From-SVN: r111399

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr26425.c [new file with mode: 0644]
gcc/tree-vrp.c

index 4400f9a6160807842558e5eececfae4f9cda353c..af10e692f11ef6eb1a733002e3012947de738202 100644 (file)
@@ -1,3 +1,9 @@
+2006-02-23  Jeff Law  <law@redhat.com>
+
+       PR tree-optimization/26425
+       * tree-vrp.c (vrp_visit_assignment): If the LHS's type has a NULL
+       min/max, then assume its varying.
+
 2006-02-23  Zdenek Dvorak <dvorakz@suse.cz>
 
        PR rtl-optimization/26316
index 3d359f123142158fdeb6ed72a48ac2f50c86f084..b9efba3f62de3115af549b8633c18ce05138f708 100644 (file)
@@ -1,3 +1,7 @@
+2006-02-23  Jeff Law  <law@redhat.com>
+
+       * gcc.c-torture/compile/pr26425.c: New test.
+
 2006-02-23  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/26412
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr26425.c b/gcc/testsuite/gcc.c-torture/compile/pr26425.c
new file mode 100644 (file)
index 0000000..8931b40
--- /dev/null
@@ -0,0 +1,9 @@
+struct keyring_list {
+ struct key *keys[0];
+};
+void keyring_destroy(struct keyring_list *keyring, unsigned short a)
+{
+ int loop;
+  for (loop = a - 1; loop >= 0; loop--)
+   key_put(keyring->keys[loop]);
+}
index 911ccb2e632272832e8d5fe022ff05366f936328..c0fb35a9e889c215c0a50d19f0dd14838e803179 100644 (file)
@@ -3375,7 +3375,11 @@ vrp_visit_assignment (tree stmt, tree *output_p)
 
   /* We only keep track of ranges in integral and pointer types.  */
   if (TREE_CODE (lhs) == SSA_NAME
-      && (INTEGRAL_TYPE_P (TREE_TYPE (lhs))
+      && ((INTEGRAL_TYPE_P (TREE_TYPE (lhs))
+          /* It is valid to have NULL MIN/MAX values on a type.  See
+             build_range_type.  */
+          && TYPE_MIN_VALUE (TREE_TYPE (lhs))
+          && TYPE_MAX_VALUE (TREE_TYPE (lhs)))
          || POINTER_TYPE_P (TREE_TYPE (lhs))))
     {
       struct loop *l;
This page took 0.114995 seconds and 5 git commands to generate.