summaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authordberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-07 23:08:23 +0000
committerdberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-07 23:08:23 +0000
commitcf48439062da095caf46e3cbf672f3e3460543f8 (patch)
tree52566fdbb0b084676aa3532c776e0d3c48a44aae /gcc/tree.c
parent4704b74336299aa76d106eb0b79897ee915c85cf (diff)
downloadgcc-cf48439062da095caf46e3cbf672f3e3460543f8.tar.gz
2007-04-07 Daniel Berlin <dberlin@dberlin.org>
Revert change removing staticp. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123650 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 816275c1f68..0ea18b2f700 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -1986,7 +1986,10 @@ staticp (tree arg)
return arg;
case COMPONENT_REF:
- gcc_assert (TREE_CODE (TREE_OPERAND (arg, 1)) == FIELD_DECL);
+ /* If the thing being referenced is not a field, then it is
+ something language specific. */
+ if (TREE_CODE (TREE_OPERAND (arg, 1)) != FIELD_DECL)
+ return (*lang_hooks.staticp) (arg);
/* If we are referencing a bitfield, we can't evaluate an
ADDR_EXPR at compile time and so it isn't a constant. */
@@ -2012,10 +2015,11 @@ staticp (tree arg)
return false;
default:
- /* All language specific tree codes should have been lowered by
- now. */
- gcc_assert_lowered (arg);
- return NULL;
+ if ((unsigned int) TREE_CODE (arg)
+ >= (unsigned int) LAST_AND_UNUSED_TREE_CODE)
+ return lang_hooks.staticp (arg);
+ else
+ return NULL;
}
}