This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
PR java/17007 Inconsistent builtin attributes set by Java front end
- From: Andrew Haley <aph at redhat dot com>
- To: java-patches at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Wed, 29 Sep 2004 15:13:42 +0100
- Subject: PR java/17007 Inconsistent builtin attributes set by Java front end
We were incorrectly setting TREE_SIDE_EFFECTS in one place, and
failing to set DECL_IS_PURE in others. This patch allows lingcj to be
built with full checking.
Andrew.
2004-09-29 Andrew Haley <aph@redhat.com>
* parse.y (patch_binop): Don't mess with the TREE_SIDE_EFFECTS of the
result of TRUNC_MOD_EXPR.
(patch_unaryop): Likewise for CONVERT_EXPR, which may throw.
* decl.c (java_init_decl_processing): Mark
soft_lookupinterfacemethod_node and soft_instanceof_node pure.
Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/decl.c,v
retrieving revision 1.197
diff -c -2 -p -r1.197 decl.c
*** decl.c 25 Aug 2004 09:52:50 -0000 1.197
--- decl.c 29 Sep 2004 12:51:31 -0000
*************** java_init_decl_processing (void)
*** 987,990 ****
--- 987,991 ----
build_function_type (boolean_type_node, t),
0, NOT_BUILT_IN, NULL, NULL_TREE);
+ DECL_IS_PURE (soft_instanceof_node) = 1;
t = tree_cons (NULL_TREE, object_ptr_type_node,
tree_cons (NULL_TREE, object_ptr_type_node, endlink));
*************** java_init_decl_processing (void)
*** 1001,1004 ****
--- 1002,1006 ----
0, NOT_BUILT_IN, NULL, NULL_TREE);
+ DECL_IS_PURE (soft_lookupinterfacemethod_node) = 1;
t = tree_cons (NULL_TREE, object_ptr_type_node,
tree_cons (NULL_TREE, ptr_type_node,
Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.512
diff -c -2 -p -r1.512 parse.y
*** parse.y 25 Sep 2004 19:11:07 -0000 1.512
--- parse.y 29 Sep 2004 12:51:35 -0000
*************** patch_binop (tree node, tree wfl_op1, tr
*** 13278,13283 ****
tree mod = build_java_binop (TRUNC_MOD_EXPR, prom_type, op1, op2);
COMPOUND_ASSIGN_P (mod) = COMPOUND_ASSIGN_P (node);
- TREE_SIDE_EFFECTS (mod)
- = TREE_SIDE_EFFECTS (op1) | TREE_SIDE_EFFECTS (op2);
return mod;
}
--- 13278,13281 ----
*************** patch_unaryop (tree node, tree wfl_op)
*** 14154,14158 ****
{
value = fold (value);
- TREE_SIDE_EFFECTS (value) = TREE_SIDE_EFFECTS (op);
return value;
}
--- 14152,14155 ----