This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] PATCH: Java gimplifier
- From: Jeff Sturm <jsturm at one-point dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 21 Jun 2003 16:26:05 -0400 (EDT)
- Subject: Re: [tree-ssa] PATCH: Java gimplifier
Hi Jason,
On Sat, 21 Jun 2003, Jason Merrill wrote:
> > ! /* Run SSA optimizers if gimplify succeeded. */
> > ! if (keep_function_tree_in_gimple_form (fndecl)
> > ! && optimize > 0 && !flag_disable_tree_ssa)
> > ! optimize_function_tree (fndecl);
>
> You shouldn't run the inliner or other tree-ssa optimizers if
> flag_disable_gimple.
Here I followed the example set by c/c++, and
keep_function_tree_in_gimple_form returns 0 if flag_disable_gimple. Is it
never safe to call optimize_inline_calls then, either? I was confused a
little by the comment in tree-inline.c:
/* I'm not real happy about this, but we need to handle gimple and
non-gimple trees. */
Is the following OK, once it passes regression testing?
Jeff
2003-06-21 Jeff Sturm <jsturm@one-point.com>
* parse.y (source_end_java_method): Don't attempt to inline
or optimize trees if flag_disable_gimple.
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 21 Jun 2003 20:20:40 -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));