summaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2002-02-08 07:51:19 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2002-02-08 07:51:19 +0000
commit64fbdcbfda3ab5fae2e116e02e1252c7b00c3f0e (patch)
tree3b6d2649163ab940f0abbf0bd184ff1bb3ee5c17 /gcc/c-common.c
parent0c5561be86279282db50fa284802db486b992fe5 (diff)
downloadgcc-64fbdcbfda3ab5fae2e116e02e1252c7b00c3f0e.tar.gz
* c-common.c (c_expand_expr): Revert 2002-02-06 patch.
* c-parse.in (compstmt): Clear last_expr_type. * parse.y (primary, primary_no_id): Use compstmt_or_stmtexpr instead of compstmt. (compstmt_or_stmtexpr): Renamed from compstmt. (compstmt): In addition to compstmt_or_stmtexpr clear last_expr_type. * gcc.c-torture/execute/20020206-1.c: Test whether nesting 2 expression statements work instead. * gcc.dg/noncompile/20020207-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49609 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 4b7946b4194..6b986d81c03 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -3466,32 +3466,22 @@ c_expand_expr (exp, target, tmode, modifier)
/* If we want the result of this expression, find the last
EXPR_STMT in the COMPOUND_STMT and mark it as addressable. */
- if (target != const0_rtx)
+ if (target != const0_rtx
+ && TREE_CODE (STMT_EXPR_STMT (exp)) == COMPOUND_STMT
+ && TREE_CODE (COMPOUND_BODY (STMT_EXPR_STMT (exp))) == SCOPE_STMT)
{
- tree expr = STMT_EXPR_STMT (exp);
- tree last;
+ tree expr = COMPOUND_BODY (STMT_EXPR_STMT (exp));
+ tree last = TREE_CHAIN (expr);
- while (TREE_CODE (expr) == COMPOUND_STMT
- && TREE_CODE (COMPOUND_BODY (expr)) == SCOPE_STMT)
+ while (TREE_CHAIN (last))
{
- expr = COMPOUND_BODY (expr);
- last = TREE_CHAIN (expr);
-
- while (TREE_CHAIN (last))
- {
- expr = last;
- last = TREE_CHAIN (last);
- }
-
- if (TREE_CODE (last) != SCOPE_STMT)
- abort ();
-
- if (TREE_CODE (expr) == EXPR_STMT)
- {
- TREE_ADDRESSABLE (expr) = 1;
- break;
- }
+ expr = last;
+ last = TREE_CHAIN (last);
}
+
+ if (TREE_CODE (last) == SCOPE_STMT
+ && TREE_CODE (expr) == EXPR_STMT)
+ TREE_ADDRESSABLE (expr) = 1;
}
expand_stmt (STMT_EXPR_STMT (exp));