diff options
author | Jeff Law <law@redhat.com> | 2006-02-23 15:47:58 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2006-02-23 15:47:58 -0700 |
commit | e260a6142ed8318481fb933dec96c93873c013d1 (patch) | |
tree | 1b539335ba44456341fd10899dfa31baedc3dcf5 /gcc | |
parent | 10c5bc6c2d22d7eddcba9a779985278a7bc58313 (diff) | |
download | gcc-e260a6142ed8318481fb933dec96c93873c013d1.zip gcc-e260a6142ed8318481fb933dec96c93873c013d1.tar.gz gcc-e260a6142ed8318481fb933dec96c93873c013d1.tar.bz2 |
re PR tree-optimization/26425 (ice on valid C code with flag -Os)
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr26425.c | 9 | ||||
-rw-r--r-- | gcc/tree-vrp.c | 6 |
4 files changed, 24 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4400f9a..af10e69 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3d359f1..b9efba3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..8931b40 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr26425.c @@ -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]); +} diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 911ccb2..c0fb35a 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -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; |