This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tree-ssa] RFA gcj patches


Hi -


The following gcj-related patches aim to solve two different problems.

The first is the removal of an annoying warning message in java/verify.c
that has been repeatedly discussed as obsolete.  It was introduced in
   http://gcc.gnu.org/ml/gcc-patches/2002-08/msg01637.html
but is declared basically obsolete later, for example
   http://gcc.gnu.org/ml/java/2003-02/msg00586.html
It shuts gcj up about valid .class files built with jdk 1.4.*.

The second patch aims to fix the gcc bz# 12211, where gcj aborts
during gimplification of constructs like:
	class foo { static int bar; }
	class zoo { void function() { foo.bar += 2; } }
because the latter foo.bar reference was expanded to something like
	COMPOUND_EXPR (SAVE_EXPR (CALL-foo-class-initializer);
                       foo.bar)
where that inner SAVE_EXPR (CALL-...) was of type void.  This messes
up the gimplifier in create_tmp_var.  The patch unmesses it.  I guess 
an alternative method might have been to have the java frontend avoid
creating such constructs in the first place, but this was less convoluted.

May I commit these?  I believe the first one could go even into mainline.


2003-10-09  Frank Ch. Eigler  <fche@redhat.com>

	* verify.c (verify_jvm_instructions): Don't warn about legal
	eh binding regions generated for example by jdk 1.4.1.

Index: java/verify.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/verify.c,v
retrieving revision 1.48.2.5
diff -u -p -r1.48.2.5 verify.c
--- java/verify.c	3 Feb 2003 17:09:21 -0000	1.48.2.5
+++ java/verify.c	9 Oct 2003 21:20:11 -0000
@@ -473,9 +473,6 @@ verify_jvm_instructions (JCF* jcf, const
 	  return 0;
 	}
 
-      if  (handler_pc >= start_pc && handler_pc < end_pc)
-	warning ("exception handler inside code that is being protected");
-
       add_handler (start_pc, end_pc,
 		   lookup_label (handler_pc),
 		   catch_type == 0 ? NULL_TREE


2003-10-09  Frank Ch. Eigler  <fche@redhat.com>

	java/12211
	* gimplify.c (gimplify_save_expr): Tolerate void-typed saved
	expressions.

Index: gimplify.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/gimplify.c,v
retrieving revision 1.1.2.89
diff -u -p -r1.1.2.89 gimplify.c
--- gimplify.c	9 Oct 2003 17:09:34 -0000	1.1.2.89
+++ gimplify.c	9 Oct 2003 21:50:59 -0000
@@ -2113,6 +2113,16 @@ gimplify_save_expr (tree *expr_p, tree *
      SAVE_EXPR node.  */
   if (is_gimple_tmp_var (val))
     *expr_p = val;
+  /* The operand may be a void-valued expression such as SAVE_EXPRs
+     generated by the Java frontend for class initialization.  It is
+     being executed only for its side-effects.  */
+  else if (TREE_TYPE (val) == void_type_node)
+    {
+      tree body = TREE_OPERAND (*expr_p, 0);
+      gimplify_expr (& body, pre_p, post_p, is_gimple_stmt, fb_none);
+      add_tree (body, pre_p);
+      *expr_p = build_empty_stmt ();
+    }
   else
     *expr_p = TREE_OPERAND (*expr_p, 0)
       = get_initialized_tmp_var (val, pre_p, post_p);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]