aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog45
-rw-r--r--gcc/java/Make-lang.in5
-rw-r--r--gcc/java/expr.c15
-rw-r--r--gcc/java/java-gimplify.c25
-rw-r--r--gcc/java/java-tree.h4
5 files changed, 74 insertions, 20 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 7fb266d..a2c3cca 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,48 @@
+2008-07-28 Richard Guenther <rguenther@suse.de>
+
+ Merge from gimple-tuples-branch.
+
+ 2008-07-18 Richard Guenther <rguenther@suse.de>
+
+ * expr.c: Include tree-iterator.h.
+ * Make-lang.in (expr.o): Add tree-iterator.h dependency.
+
+ 2008-07-18 Aldy Hernandez <aldyh@redhat.com>
+
+ * java-gimplify.c: Include gimple.h instead of tree-gimple.h.
+ * expr.c: Same.
+
+ 2008-07-14 Aldy Hernandez <aldyh@redhat.com>
+
+ * java-gimplify.c (java_gimplify_expr): Same.
+ (java_gimplify_modify_expr): Same.
+ * java-tree.h: Rename GENERIC_NEXT to TREE_CHAIN.
+
+ 2008-05-02 Diego Novillo <dnovillo@google.com>
+
+ * expr.c (build_java_throw_out_of_bounds_exception): Fix
+ mixed declarations and code.
+
+ 2008-05-02 Doug Kwan <dougkwan@google.com>
+
+ * expr.c (build_java_throw_out_of_bounds_exception ): Wrap call to
+ _Jv_ThrowBadArrayIndex with a COMPOUND_EXPR to return 0.
+
+ 2008-02-19 Diego Novillo <dnovillo@google.com>
+
+ http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00804.html
+
+ * java-gimplify.c (java_gimplify_self_mod_expr): Change
+ gimple_seq arguments to gimple_seq *. Update all users.
+
+ 2007-11-26 Aldy Hernandez <aldyh@redhat.com>
+
+ * java-gimplify.c (java_gimplify_expr): Make pre_p and post_p
+ sequences.
+ (java_gimplify_self_mod_expr): Same.
+ * java-tree.h (java_gimplify_expr): Make pre_p and post_p
+ sequences.
+
2008-07-24 Jan Hubicka <jh@suse.cz>
* java/decl.c: Include cgraph.h
diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in
index c5446db..f188c7d 100644
--- a/gcc/java/Make-lang.in
+++ b/gcc/java/Make-lang.in
@@ -269,7 +269,8 @@ java/except.o: java/except.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h $(REAL_H) \
java/expr.o: java/expr.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h $(REAL_H) \
$(RTL_H) $(EXPR_H) java/javaop.h java/java-opcodes.h except.h \
java/java-except.h java/java-except.h java/parse.h toplev.h \
- $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) gt-java-expr.h $(TARGET_H)
+ $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) gt-java-expr.h $(TARGET_H) \
+ tree-iterator.h
java/jcf-depend.o: java/jcf-depend.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) java/jcf.h
java/jcf-parse.o: java/jcf-parse.c $(CONFIG_H) $(JAVA_TREE_H) $(FLAGS_H) \
@@ -298,7 +299,7 @@ java/verify-impl.o: java/verify-impl.c $(CONFIG_H) java/verify.h $(SYSTEM_H) \
java/zextract.o: java/zextract.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
java/zipfile.h
java/java-gimplify.o: java/java-gimplify.c $(CONFIG_H) $(SYSTEM_H) \
- coretypes.h $(TM_H) $(JAVA_TREE_H) $(TREE_GIMPLE_H) toplev.h
+ coretypes.h $(TM_H) $(JAVA_TREE_H) $(GIMPLE_H) toplev.h
# jcf-io.o needs $(ZLIBINC) added to cflags.
java/jcf-io.o: java/jcf-io.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index c64f6d6..ff28bbb 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -42,7 +42,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "toplev.h"
#include "except.h"
#include "ggc.h"
-#include "tree-gimple.h"
+#include "tree-iterator.h"
+#include "gimple.h"
#include "target.h"
static void flush_quick_stack (void);
@@ -814,10 +815,20 @@ encode_newarray_type (tree type)
static tree
build_java_throw_out_of_bounds_exception (tree index)
{
- tree node = build_call_nary (int_type_node,
+ tree node;
+
+ /* We need to build a COMPOUND_EXPR because _Jv_ThrowBadArrayIndex()
+ has void return type. We cannot just set the type of the CALL_EXPR below
+ to int_type_node because we would lose it during gimplification. */
+ gcc_assert (VOID_TYPE_P (TREE_TYPE (TREE_TYPE (soft_badarrayindex_node))));
+ node = build_call_nary (void_type_node,
build_address_of (soft_badarrayindex_node),
1, index);
+ TREE_SIDE_EFFECTS (node) = 1;
+
+ node = build2 (COMPOUND_EXPR, int_type_node, node, integer_zero_node);
TREE_SIDE_EFFECTS (node) = 1; /* Allows expansion within ANDIF */
+
return (node);
}
diff --git a/gcc/java/java-gimplify.c b/gcc/java/java-gimplify.c
index 5358241..790cb13 100644
--- a/gcc/java/java-gimplify.c
+++ b/gcc/java/java-gimplify.c
@@ -28,12 +28,13 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "tree.h"
#include "java-tree.h"
#include "tree-dump.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "toplev.h"
static tree java_gimplify_block (tree);
static enum gimplify_status java_gimplify_modify_expr (tree *);
-static enum gimplify_status java_gimplify_self_mod_expr (tree*, tree*, tree *);
+static enum gimplify_status java_gimplify_self_mod_expr (tree *, gimple_seq *,
+ gimple_seq *);
static void dump_java_tree (enum tree_dump_index, tree);
@@ -53,8 +54,7 @@ java_genericize (tree fndecl)
/* Gimplify a Java tree. */
int
-java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED,
- tree *post_p ATTRIBUTE_UNUSED)
+java_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
{
enum tree_code code = TREE_CODE (*expr_p);
@@ -68,9 +68,6 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED,
*expr_p = java_replace_reference (*expr_p, /* want_lvalue */ false);
return GS_UNHANDLED;
- /* We don't handle GIMPLE_MODIFY_STMT, as MODIFY_EXPRs with java
- semantics should only be generated by the front-end, and never
- by anything after gimplification. */
case MODIFY_EXPR:
return java_gimplify_modify_expr (expr_p);
@@ -142,7 +139,7 @@ java_gimplify_modify_expr (tree *modify_expr_p)
{
tree new_lhs = java_replace_reference (lhs, /* want_lvalue */ true);
tree new_rhs = build1 (NOP_EXPR, TREE_TYPE (new_lhs), rhs);
- modify_expr = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (new_lhs),
+ modify_expr = build2 (MODIFY_EXPR, TREE_TYPE (new_lhs),
new_lhs, new_rhs);
modify_expr = build1 (NOP_EXPR, lhs_type, modify_expr);
}
@@ -160,8 +157,8 @@ java_gimplify_modify_expr (tree *modify_expr_p)
between the reading and the writing. */
static enum gimplify_status
-java_gimplify_self_mod_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED,
- tree *post_p ATTRIBUTE_UNUSED)
+java_gimplify_self_mod_expr (tree *expr_p, gimple_seq *pre_p ATTRIBUTE_UNUSED,
+ gimple_seq *post_p ATTRIBUTE_UNUSED)
{
tree lhs = TREE_OPERAND (*expr_p, 0);
@@ -180,7 +177,7 @@ java_gimplify_block (tree java_block)
{
tree decls = BLOCK_VARS (java_block);
tree body = BLOCK_EXPR_BODY (java_block);
- tree outer = gimple_current_bind_expr ();
+ gimple outer = gimple_current_bind_expr ();
tree block;
/* Don't bother with empty blocks. */
@@ -199,10 +196,10 @@ java_gimplify_block (tree java_block)
routines generate info for the variables in that block. */
TREE_USED (block) = 1;
- if (outer != NULL_TREE)
+ if (outer != NULL)
{
- outer = BIND_EXPR_BLOCK (outer);
- BLOCK_SUBBLOCKS (outer) = chainon (BLOCK_SUBBLOCKS (outer), block);
+ tree b = gimple_bind_block (outer);
+ BLOCK_SUBBLOCKS (b) = chainon (BLOCK_SUBBLOCKS (b), block);
}
BLOCK_EXPR_BODY (java_block) = NULL_TREE;
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h
index a046a0f..7ae71d9 100644
--- a/gcc/java/java-tree.h
+++ b/gcc/java/java-tree.h
@@ -649,7 +649,7 @@ struct lang_identifier GTY(())
/* The resulting tree type. */
union lang_tree_node
GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"),
- chain_next ("(union lang_tree_node *)GENERIC_NEXT (&%h.generic)")))
+ chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
{
union tree_node GTY ((tag ("0"),
@@ -1555,7 +1555,7 @@ enum
#undef DEBUG_JAVA_BINDING_LEVELS
extern void java_genericize (tree);
-extern int java_gimplify_expr (tree *, tree *, tree *);
+extern int java_gimplify_expr (tree *, gimple_seq *, gimple_seq *);
extern FILE *finput;