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]

Re: [tree-ssa] PATCH: Java gimplifier


On Sat, 21 Jun 2003, Jason Merrill wrote:
> The inliner handles GENERIC, not just GIMPLE, but it doesn't handle
> Java-specific (or C-specific) trees.  For instance, it wouldn't know what
> to do with a Java block expr.

Oh, I see.  (Perhaps it would silently ignore Java trees without inlining
them; see below.)

> > Is the following OK, once it passes regression testing?
>
> Yes, thanks.  Oh, and it occurs to me that you should switch over from
> old-tree-inline.o to tree-inline.o; now that the Java front end doesn't
> need it, old-tree-inline.o can go away.

That's funny, java wasn't using old-tree-inline.c whatsoever; I removed
that source file from my tree and bootstrapped to prove it.  It must have
(unintentionally?) switched over some time ago.

I'm installing the make bits as obvious.  Bootstrapped on
i686-pc-linux-gnu.

Jeff

2003-06-22  Jeff Sturm  <jsturm@one-point.com>

    * parse.y (source_end_java_method): Don't attempt to inline
    or optimize trees if flag_disable_gimple.

    * Make-lang.in (JAVA_OBJS): Remove java-tree-inline.o.

Index: Make-lang.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Make-lang.in,v
retrieving revision 1.88.2.11
diff -c -p -r1.88.2.11 Make-lang.in
*** Make-lang.in	21 Jun 2003 18:20:59 -0000	1.88.2.11
--- Make-lang.in	22 Jun 2003 20:06:09 -0000
*************** JAVA_OBJS = java/parse.o java/class.o ja
*** 110,117 ****
    java/zextract.o java/jcf-io.o java/jcf-parse.o java/mangle.o \
    java/mangle_name.o java/builtins.o java/resource.o \
    java/jcf-write.o java/buffer.o java/check-init.o java/jcf-depend.o \
!   java/jcf-path.o java/xref.o java/boehm.o java/java-tree-inline.o \
!   java/java-gimplify.o mkdeps.o

  GCJH_OBJS = java/gjavah.o java/jcf-io.o java/jcf-depend.o java/jcf-path.o \
    java/zextract.o version.o mkdeps.o errors.o ggc-none.o
--- 110,116 ----
    java/zextract.o java/jcf-io.o java/jcf-parse.o java/mangle.o \
    java/mangle_name.o java/builtins.o java/resource.o \
    java/jcf-write.o java/buffer.o java/check-init.o java/jcf-depend.o \
!   java/jcf-path.o java/xref.o java/boehm.o java/java-gimplify.o mkdeps.o

  GCJH_OBJS = java/gjavah.o java/jcf-io.o java/jcf-depend.o java/jcf-path.o \
    java/zextract.o version.o mkdeps.o errors.o ggc-none.o
*************** java/expr.o: java/expr.c $(CONFIG_H) $(J
*** 303,315 ****
    $(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
- java/java-tree-inline.o: tree-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
-    $(TM_H) $(TREE_H) $(RTL_H) expr.h flags.h params.h input.h insn-config.h \
-    $(INTEGRATE_H) $(VARRAY_H) $(HASHTAB_H) $(SPLAY_TREE_H) toplev.h \
-    langhooks.h $(srcdir)/tree-inline.h
- 	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
- 	-DINLINER_FOR_JAVA=1 \
- 	$(srcdir)/tree-inline.c -o $@
  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 \
--- 302,307 ----
Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.387.2.23
diff -c -p -r1.387.2.23 parse.y
*** parse.y	21 Jun 2003 18:21:00 -0000	1.387.2.23
--- parse.y	22 Jun 2003 20:06:10 -0000
*************** source_end_java_method (void)
*** 7387,7407 ****
  	  cfun->x_whole_function_mode_p = 1;
  	  gimplify_function_tree (fndecl);
  	  dump_function (TDI_gimple, fndecl);
- 	}

!       /* Inline suitable calls from this function.  */
!       if (flag_inline_trees)
! 	{
! 	  timevar_push (TV_INTEGRATION);
! 	  optimize_inline_calls (fndecl);
! 	  timevar_pop (TV_INTEGRATION);
! 	  dump_function (TDI_inlined, fndecl);
! 	}

!       /* Run SSA optimizers if gimplify succeeded.  */
!       if (keep_function_tree_in_gimple_form (fndecl)
! 	  && optimize > 0 && !flag_disable_tree_ssa)
! 	optimize_function_tree (fndecl);

        /* Generate function's code.  */
        expand_expr_stmt (DECL_SAVED_TREE (fndecl));
--- 7387,7407 ----
  	  cfun->x_whole_function_mode_p = 1;
  	  gimplify_function_tree (fndecl);
  	  dump_function (TDI_gimple, fndecl);

! 	  /* Inline suitable calls from this function.  */
! 	  if (flag_inline_trees)
! 	    {
! 	      timevar_push (TV_INTEGRATION);
! 	      optimize_inline_calls (fndecl);
! 	      timevar_pop (TV_INTEGRATION);
! 	      dump_function (TDI_inlined, fndecl);
! 	    }

! 	  /* Run SSA optimizers if gimplify succeeded.  */
! 	  if (keep_function_tree_in_gimple_form (fndecl)
! 	      && optimize > 0 && !flag_disable_tree_ssa)
! 	    optimize_function_tree (fndecl);
! 	}

        /* Generate function's code.  */
        expand_expr_stmt (DECL_SAVED_TREE (fndecl));


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