diff options
author | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-12-20 05:00:50 +0000 |
---|---|---|
committer | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-12-20 05:00:50 +0000 |
commit | 8d665d11985d6b49622470f839796b725ab37a27 (patch) | |
tree | df882d04a823c13b4fd210d1da5ce8af48652fef /gcc/tree-vrp.c | |
parent | d0e55906d8b9759252180aa5377e7c997d65ffd8 (diff) | |
download | gcc-8d665d11985d6b49622470f839796b725ab37a27.tar.gz |
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
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120069 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 483607ec554..302a6201bf0 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)); |