From: Tom Tromey Date: Fri, 24 Sep 2004 15:39:17 +0000 (+0000) Subject: re PR java/16789 (ICE in force_evaluation_order() on valid code) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=90424847a67993e2cb9b0832371f45b2b64d9048;p=gcc.git re PR java/16789 (ICE in force_evaluation_order() on valid code) PR java/16789: * parse.y (resolve_qualified_expression_name): Set CAN_COMPLETE_NORMALLY on first call when chaining static calls. * expr.c (force_evaluation_order): Check for empty argument list after stripping COMPOUND_EXPR. From-SVN: r88045 --- diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 0e2b8b1e353..f66e444e601 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,11 @@ +2004-09-24 Tom Tromey + + PR java/16789: + * parse.y (resolve_qualified_expression_name): Set + CAN_COMPLETE_NORMALLY on first call when chaining static calls. + * expr.c (force_evaluation_order): Check for empty argument list + after stripping COMPOUND_EXPR. + 2004-09-23 Andrew Haley PR java/16927: diff --git a/gcc/java/expr.c b/gcc/java/expr.c index 33d3afdd3c0..33c048fe5e4 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -3178,9 +3178,6 @@ force_evaluation_order (tree node) { tree arg, cmp; - if (!TREE_OPERAND (node, 1)) - return node; - arg = node; /* Position arg properly, account for wrapped around ctors. */ @@ -3189,7 +3186,11 @@ force_evaluation_order (tree node) arg = TREE_OPERAND (arg, 1); - /* Not having a list of argument here is an error. */ + /* An empty argument list is ok, just ignore it. */ + if (!arg) + return node; + + /* Not having a list of arguments here is an error. */ if (TREE_CODE (arg) != TREE_LIST) abort (); diff --git a/gcc/java/parse.y b/gcc/java/parse.y index b6cedbfc37b..2287d9075d2 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -9607,6 +9607,9 @@ resolve_qualified_expression_name (tree wfl, tree *found_decl, forcoming function's argument. */ if (previous_call_static && is_static) { + /* We must set CAN_COMPLETE_NORMALLY for the first call + since it is done nowhere else. */ + CAN_COMPLETE_NORMALLY (decl) = 1; decl = build2 (COMPOUND_EXPR, TREE_TYPE (*where_found), decl, *where_found); TREE_SIDE_EFFECTS (decl) = 1;