This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Stay in GIMPLE when inlining
> On Fri, May 13, 2005 at 01:56:33AM +0200, Jan Hubicka wrote:
> > * tree-inline.c (copy_body_r): Simplify substituted ADDR_EXPRs.
> > * tree-optimize.c (pass_gimple): Kill.
> > (init_tree_optimization_passes): Kill pass_gimple.
> > (tree_rest_of_compilation): Do verify_stmts to check that we are gimple.
>
> Ok, except,
>
> > * pr15791-?.C: Replace gimple by lower dump.
> > * pr15791-?.c: Replace gimple by lower dump.
> > buidins-47.c: Likewise.
>
> Rather than removing the gimple dump, rename the generic dump.
>
> There's probably other cleanup to be done in this area.
So just, to be sure, you mean replacing tree-generic dump by tree-gimple
in passes.c? I am testing the updated patch and will update testcases
accordingly if some of them happens to check the generic dump.
Honza
Index: tree-dump.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-dump.c,v
retrieving revision 1.41
diff -c -3 -p -r1.41 tree-dump.c
*** tree-dump.c 23 Apr 2005 21:27:58 -0000 1.41
--- tree-dump.c 13 May 2005 00:49:16 -0000
*************** static struct dump_file_info dump_files[
*** 672,678 ****
{".tu", "translation-unit", NULL, TDF_TREE, 0, 0, 0},
{".class", "class-hierarchy", NULL, TDF_TREE, 0, 1, 0},
{".original", "tree-original", NULL, TDF_TREE, 0, 2, 0},
! {".generic", "tree-generic", NULL, TDF_TREE, 0, 3, 0},
{".nested", "tree-nested", NULL, TDF_TREE, 0, 4, 0},
{".inlined", "tree-inlined", NULL, TDF_TREE, 0, 5, 0},
{".vcg", "tree-vcg", NULL, TDF_TREE, 0, 6, 0},
--- 672,678 ----
{".tu", "translation-unit", NULL, TDF_TREE, 0, 0, 0},
{".class", "class-hierarchy", NULL, TDF_TREE, 0, 1, 0},
{".original", "tree-original", NULL, TDF_TREE, 0, 2, 0},
! {".gimple", "tree-gimple", NULL, TDF_TREE, 0, 3, 0},
{".nested", "tree-nested", NULL, TDF_TREE, 0, 4, 0},
{".inlined", "tree-inlined", NULL, TDF_TREE, 0, 5, 0},
{".vcg", "tree-vcg", NULL, TDF_TREE, 0, 6, 0},
Index: tree-inline.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v
retrieving revision 1.182
diff -c -3 -p -r1.182 tree-inline.c
*** tree-inline.c 23 Apr 2005 21:27:58 -0000 1.182
--- tree-inline.c 13 May 2005 00:49:16 -0000
*************** copy_body_r (tree *tp, int *walk_subtree
*** 566,586 ****
{
/* Get rid of *& from inline substitutions that can happen when a
pointer argument is an ADDR_EXPR. */
! tree decl = TREE_OPERAND (*tp, 0), value;
splay_tree_node n;
n = splay_tree_lookup (id->decl_map, (splay_tree_key) decl);
if (n)
{
! value = (tree) n->value;
! STRIP_NOPS (value);
! if (TREE_CODE (value) == ADDR_EXPR
! && (lang_hooks.types_compatible_p
! (TREE_TYPE (*tp), TREE_TYPE (TREE_OPERAND (value, 0)))))
! {
! *tp = TREE_OPERAND (value, 0);
! return copy_body_r (tp, walk_subtrees, data);
! }
}
}
--- 566,580 ----
{
/* Get rid of *& from inline substitutions that can happen when a
pointer argument is an ADDR_EXPR. */
! tree decl = TREE_OPERAND (*tp, 0);
splay_tree_node n;
n = splay_tree_lookup (id->decl_map, (splay_tree_key) decl);
if (n)
{
! *tp = build_fold_indirect_ref ((tree)n->value);
! *walk_subtrees = 0;
! return NULL;
}
}
Index: tree-optimize.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-optimize.c,v
retrieving revision 2.91
diff -c -3 -p -r2.91 tree-optimize.c
*** tree-optimize.c 12 May 2005 19:29:21 -0000 2.91
--- tree-optimize.c 13 May 2005 00:49:16 -0000
*************** bool in_gimple_form;
*** 57,81 ****
/* The root of the compilation pass tree, once constructed. */
static struct tree_opt_pass *all_passes, *all_ipa_passes;
- /* Pass: dump the gimplified, inlined, functions. */
-
- static struct tree_opt_pass pass_gimple =
- {
- "gimple", /* name */
- NULL, /* gate */
- NULL, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- 0, /* tv_id */
- 0, /* properties_required */
- PROP_gimple_any, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_dump_func, /* todo_flags_finish */
- 0 /* letter */
- };
-
/* Gate: execute, or not, all of the non-trivial optimizations. */
static bool
--- 57,62 ----
*************** init_tree_optimization_passes (void)
*** 340,346 ****
*p = NULL;
p = &all_passes;
- NEXT_PASS (pass_gimple);
NEXT_PASS (pass_remove_useless_stmts);
NEXT_PASS (pass_mudflap_1);
NEXT_PASS (pass_lower_cf);
--- 321,326 ----
*************** tree_rest_of_compilation (tree fndecl)
*** 730,735 ****
--- 710,719 ----
/* Initialize the default bitmap obstack. */
bitmap_obstack_initialize (NULL);
bitmap_obstack_initialize (®_obstack); /* FIXME, only at RTL generation*/
+
+ #ifdef ENABLE_CHECING
+ verify_stmts ();
+ #endif
/* Perform all tree transforms and optimizations. */
execute_pass_list (all_passes);