expr.c (java_check_reference): Use the semantics of COND_EXPRs with void-type branche...
authorRoger Sayle <roger@eyesopen.com>
Sun, 28 Sep 2003 15:07:05 +0000 (15:07 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Sun, 28 Sep 2003 15:07:05 +0000 (15:07 +0000)
* expr.c (java_check_reference): Use the semantics of COND_EXPRs
with void-type branches instead of using a COMPOUND_EXPR.

From-SVN: r71883

gcc/java/ChangeLog
gcc/java/expr.c

index 93eb1c2..4ec9a3c 100644 (file)
@@ -1,3 +1,8 @@
+2003-09-28  Roger Sayle  <roger@eyesopen.com>
+
+       * expr.c (java_check_reference): Use the semantics of COND_EXPRs
+       with void-type branches instead of using a COMPOUND_EXPR.
+
 2003-09-28  Jeff Sturm  <jsturm@one-point.com>
 
        * decl.c (java_optimize_inline, dump_function): Remove.
index 272cb35..994a8c5 100644 (file)
@@ -695,15 +695,13 @@ java_check_reference (tree expr, int check)
 {
   if (!flag_syntax_only && check)
     {
-      tree cond;
       expr = save_expr (expr);
-      cond = build (COND_EXPR, void_type_node,
+      expr = build (COND_EXPR, TREE_TYPE (expr),
                    build (EQ_EXPR, boolean_type_node, expr, null_pointer_node),
                    build (CALL_EXPR, void_type_node, 
                           build_address_of (soft_nullpointer_node),
                           NULL_TREE, NULL_TREE),
-                   empty_stmt_node);
-      expr = build (COMPOUND_EXPR, TREE_TYPE (expr), cond, expr);
+                   expr);
     }
 
   return expr;