summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/c-semantics.c
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2005-06-03 03:28:44 +0000
committerkan <kan@FreeBSD.org>2005-06-03 03:28:44 +0000
commit2156e40a831a8e0ab68e4bc091c2940bf46ca6df (patch)
treef0dc8ad34f9fcaf27052e24e893a4284b5fee6e9 /contrib/gcc/c-semantics.c
parent0a20abcc95340c9d2bb59421bac84eca4fb43b0c (diff)
downloadFreeBSD-src-2156e40a831a8e0ab68e4bc091c2940bf46ca6df.zip
FreeBSD-src-2156e40a831a8e0ab68e4bc091c2940bf46ca6df.tar.gz
Gcc 3.4.4 release.
Diffstat (limited to 'contrib/gcc/c-semantics.c')
-rw-r--r--contrib/gcc/c-semantics.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/contrib/gcc/c-semantics.c b/contrib/gcc/c-semantics.c
index 38c4021..692adfc 100644
--- a/contrib/gcc/c-semantics.c
+++ b/contrib/gcc/c-semantics.c
@@ -937,6 +937,9 @@ expand_unreachable_if_stmt (tree t)
return true;
}
+ /* Account for declarations as conditions. */
+ expand_cond (IF_COND (t));
+
if (THEN_CLAUSE (t) && ELSE_CLAUSE (t))
{
n = expand_unreachable_stmt (THEN_CLAUSE (t), 0);
@@ -969,7 +972,9 @@ expand_unreachable_if_stmt (tree t)
/* Expand an unreachable statement list. This function skips all
statements preceding the first potentially reachable label and
then returns the label (or, in same cases, the statement after
- one containing the label). */
+ one containing the label). This function returns NULL_TREE if
+ the end of the given statement list is unreachable, and a
+ non-NULL value, possibly error_mark_node, otherwise. */
static tree
expand_unreachable_stmt (tree t, int warn)
{
@@ -1019,7 +1024,7 @@ expand_unreachable_stmt (tree t, int warn)
case IF_STMT:
if (expand_unreachable_if_stmt (t))
- return TREE_CHAIN (t);
+ return TREE_CHAIN (t) ? TREE_CHAIN (t) : error_mark_node;
break;
case WHILE_STMT:
@@ -1027,7 +1032,7 @@ expand_unreachable_stmt (tree t, int warn)
no need to rotate the loop, instead the WHILE_STMT can be
expanded like a DO_STMT. */
genrtl_do_stmt_1 (WHILE_COND (t), WHILE_BODY (t));
- return TREE_CHAIN (t);
+ return TREE_CHAIN (t) ? TREE_CHAIN (t) : error_mark_node;
case COMPOUND_STMT:
{
@@ -1036,7 +1041,7 @@ expand_unreachable_stmt (tree t, int warn)
if (n != NULL_TREE)
{
expand_stmt (n);
- return TREE_CHAIN (t);
+ return TREE_CHAIN (t) ? TREE_CHAIN (t) : error_mark_node;
}
warn = false;
break;
OpenPOWER on IntegriCloud