aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@gcc.gnu.org>2006-12-19 21:00:50 -0800
committerAndrew Pinski <pinskia@gcc.gnu.org>2006-12-19 21:00:50 -0800
commit7954dc21214b87ad8b3cf26994af00f968fcba78 (patch)
treedf882d04a823c13b4fd210d1da5ce8af48652fef /gcc/tree-vrp.c
parent69a0f8c61ea99c4cc9dc551e7523180e197d525f (diff)
downloadgcc-7954dc21214b87ad8b3cf26994af00f968fcba78.zip
gcc-7954dc21214b87ad8b3cf26994af00f968fcba78.tar.gz
gcc-7954dc21214b87ad8b3cf26994af00f968fcba78.tar.bz2
re PR tree-optimization/30045 (ICE in nonnull_arg_p with the CHAIN decl)
2006-12-19 Andrew Pinski <pinskia@gmail.com> PR tree-opt/30045 * tree-vrp.c (nonnull_arg_p): Treat the static decl as always non null. 2006-12-19 Andrew Pinski <pinskia@gmail.com> PR tree-opt/30045 * gcc.dg/pr30045.c: New test From-SVN: r120069
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 483607e..302a620 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -102,6 +102,10 @@ nonnull_arg_p (tree arg)
gcc_assert (TREE_CODE (arg) == PARM_DECL && POINTER_TYPE_P (TREE_TYPE (arg)));
+ /* The static chain decl is always non null. */
+ if (arg == cfun->static_chain_decl)
+ return true;
+
fntype = TREE_TYPE (current_function_decl);
attrs = lookup_attribute ("nonnull", TYPE_ATTRIBUTES (fntype));