OSDN Git Service

PR tree-optimization/26425
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 23 Feb 2006 22:47:58 +0000 (22:47 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 23 Feb 2006 22:47:58 +0000 (22:47 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111399 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 4400f9a..af10e69 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 3d359f1..b9efba3 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 911ccb2..c0fb35a 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;