summaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-27 00:55:38 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-27 00:55:38 +0000
commit5e1a75c5bb2b9881d906142ed8e1a320ec1dbfc5 (patch)
tree6c427b8f84f25b3a3314f74ca5ce1571788772a7 /gcc/tree.c
parentaf28855bc1af90aa53b5de0a91ef843dce967545 (diff)
downloadgcc-5e1a75c5bb2b9881d906142ed8e1a320ec1dbfc5.tar.gz
Update comment for staticp.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86652 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 27efff1d49f..1c5060e5869 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -1363,8 +1363,9 @@ array_type_nelts (tree type)
: fold (build2 (MINUS_EXPR, TREE_TYPE (max), max, min)));
}
-/* Return true if arg is static -- a reference to an object in
- static storage. This is not the same as the C meaning of `static'. */
+/* If arg is static -- a reference to an object in static storage -- then
+ return the object. This is not the same as the C meaning of `static'.
+ If arg isn't static, return NULL. */
tree
staticp (tree arg)
@@ -2270,7 +2271,11 @@ do { tree _node = (NODE); \
address of a volatile variable is not volatile.) If it's a constant,
the address is both invariant and constant. Otherwise it's neither. */
if (TREE_CODE (node) == INDIRECT_REF)
- UPDATE_TITCSE (node);
+ {
+ /* If this is &((T*)0)->field, then this is a form of addition. */
+ if (TREE_CODE (TREE_OPERAND (node, 0)) != INTEGER_CST)
+ UPDATE_TITCSE (node);
+ }
else if (DECL_P (node))
{
if (staticp (node))