builtins-43.c: Use gimple dump instead of generic.

* gcc.dg/builtins-43.c: Use gimple dump instead of generic.
	* gcc.dg/fold-xor-?.c: Likewise.
	* gcc.dg/pr15784-?.c: Likewise.
	* gcc.dg/pr20922-?.c: Likewise.
	* gcc.dg/tree-ssa/20050128-1.c: Likewise.
	* gcc.dg/tree-ssa/pr17598.c: Likewise.
	* gcc.dg/tree-ssa/pr20470.c: Likewise.

	* tree-inline.c (copy_body_r): Simplify substituted ADDR_EXPRs.
	* tree-optimize.c (pass_gimple): Kill.
	(init_tree_optimization_passes): Kill pass_gimple.
	* tree-cfg.c (build_tree_cfg): Do verify_stmts to check that we are gimple.
	* tree-dump.c (dump_files): Rename .generic to .gimple.*

From-SVN: r99658
This commit is contained in:
Jan Hubicka 2005-05-13 15:57:19 +02:00 committed by Jan Hubicka
parent 618656ff89
commit 81cfbbc23c
22 changed files with 78 additions and 82 deletions

View file

@ -1,3 +1,11 @@
2005-05-13 Jan Hubicka <jh@suse.cz>
* tree-inline.c (copy_body_r): Simplify substituted ADDR_EXPRs.
* tree-optimize.c (pass_gimple): Kill.
(init_tree_optimization_passes): Kill pass_gimple.
* tree-cfg.c (build_tree_cfg): Do verify_stmts to check that we are gimple.
* tree-dump.c (dump_files): Rename .generic to .gimple.*
2005-05-13 J"orn Rennecke <joern.rennecke@st.com>
PR rtl-optimization/20756:

View file

@ -1,3 +1,13 @@
2005-05-13 Jan Hubicka <jh@suse.cz>
* gcc.dg/builtins-43.c: Use gimple dump instead of generic.
* gcc.dg/fold-xor-?.c: Likewise.
* gcc.dg/pr15784-?.c: Likewise.
* gcc.dg/pr20922-?.c: Likewise.
* gcc.dg/tree-ssa/20050128-1.c: Likewise.
* gcc.dg/tree-ssa/pr17598.c: Likewise.
* gcc.dg/tree-ssa/pr20470.c: Likewise.
2005-05-11 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/21260

View file

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O1 -fno-trapping-math -fdump-tree-generic -fdump-tree-optimized" } */
/* { dg-options "-O1 -fno-trapping-math -fdump-tree-gimple -fdump-tree-optimized" } */
extern void f(int);
extern void link_error ();
@ -46,8 +46,8 @@ main ()
/* Check that all instances of __builtin_isnan were folded. */
/* { dg-final { scan-tree-dump-times "isnan" 0 "generic" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */
/* { dg-final { scan-tree-dump-times "isnan" 0 "gimple" } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */
/* Check that all instances of link_error were subject to DCE. */
/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */

View file

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-fdump-tree-generic" } */
/* { dg-options "-fdump-tree-gimple" } */
int f (int a, int b) {
return ~a ^ ~b;
@ -8,5 +8,5 @@ int f (int a, int b) {
unsigned int g (unsigned int a, unsigned int b) {
return ~a ^ ~b;
}
/* { dg-final { scan-tree-dump-times "a \\^ b" 2 "generic" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */
/* { dg-final { scan-tree-dump-times "a \\^ b" 2 "gimple" } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */

View file

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-fdump-tree-generic" } */
/* { dg-options "-fdump-tree-gimple" } */
int f (int a, int b) {
return ~(a ^ -(b + 1));
}
@ -12,5 +12,5 @@ unsigned int h (unsigned int a, unsigned int b) {
return ~(-(b + 1) ^ a);
}
/* { dg-final { scan-tree-dump-times "b \\^ a" 3 "generic" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */
/* { dg-final { scan-tree-dump-times "b \\^ a" 3 "gimple" } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */

View file

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-fdump-tree-generic" } */
/* { dg-options "-fdump-tree-gimple" } */
/* Test for folding abs(x) where appropriate. */
#define abs(x) x > 0 ? x : -x
extern double fabs (double);
@ -39,5 +39,5 @@ int h (float x) {
int i (float x) {
return fabs(x) == -0.0;
}
/* { dg-final { scan-tree-dump-times "ABS_EXPR" 0 "generic" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */
/* { dg-final { scan-tree-dump-times "ABS_EXPR" 0 "gimple" } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */

View file

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-fdump-tree-generic -ffast-math" } */
/* { dg-options "-fdump-tree-gimple -ffast-math" } */
/* Test for folding abs(x) where appropriate. */
#define abs(x) x > 0 ? x : -x
extern double fabs (double);
@ -8,5 +8,5 @@ int a (float x) {
return fabs(x) >= 0.0;
}
/* { dg-final { scan-tree-dump-times "ABS_EXPR" 0 "generic" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */
/* { dg-final { scan-tree-dump-times "ABS_EXPR" 0 "gimple" } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */

View file

@ -1,6 +1,6 @@
/* { dg-do compile } */
/* SH4 without -mieee defaults to -ffinite-math-only. */
/* { dg-options "-fdump-tree-generic -fno-finite-math-only" } */
/* { dg-options "-fdump-tree-gimple -fno-finite-math-only" } */
/* Test for folding abs(x) where appropriate. */
#define abs(x) x > 0 ? x : -x
extern double fabs (double);
@ -9,5 +9,5 @@ int a (float x) {
return fabs(x) >= 0.0;
}
/* { dg-final { scan-tree-dump-times "ABS_EXPR" 1 "generic" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */
/* { dg-final { scan-tree-dump-times "ABS_EXPR" 1 "gimple" } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */

View file

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-fdump-tree-generic" } */
/* { dg-options "-fdump-tree-gimple" } */
int z (int a) {
return a * -1;
}
@ -11,4 +11,4 @@ int x (int a) {
int y (int a) {
return -(-1 * -a);
}
/* { dg-final { scan-tree-dump-times "-a" 3 "generic" } } */
/* { dg-final { scan-tree-dump-times "-a" 3 "gimple" } } */

View file

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-fno-wrapv -fdump-tree-generic" } */
/* { dg-options "-fno-wrapv -fdump-tree-gimple" } */
int f(int i)
{
return (i - 2) > i;
@ -34,5 +34,5 @@ int z(double i)
{
return (i + (-2.0)) > i;
}
/* { dg-final { scan-tree-dump-times " = 0" 7 "generic" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */
/* { dg-final { scan-tree-dump-times " = 0" 7 "gimple" } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */

View file

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-fwrapv -fdump-tree-generic" } */
/* { dg-options "-fwrapv -fdump-tree-gimple" } */
int f (int i)
{
return (i - 2) > i;
@ -14,5 +14,5 @@ int h (double i)
{
return (i + 2.0) <= i;
}
/* { dg-final { scan-tree-dump-times " = 0" 0 "generic" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */
/* { dg-final { scan-tree-dump-times " = 0" 0 "gimple" } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */

View file

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-ffast-math -fno-wrapv -fdump-tree-generic" } */
/* { dg-options "-ffast-math -fno-wrapv -fdump-tree-gimple" } */
int f(int i)
{
return (i - 2) <= i;
@ -29,5 +29,5 @@ int z(double i)
{
return (i + (-2.0)) <= i;
}
/* { dg-final { scan-tree-dump-times " = 1" 6 "generic" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */
/* { dg-final { scan-tree-dump-times " = 1" 6 "gimple" } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */

View file

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-fno-wrapv -fdump-tree-generic" } */
/* { dg-options "-fno-wrapv -fdump-tree-gimple" } */
int f(int i)
{
return i < (i - 2);
@ -34,5 +34,5 @@ int z(double i)
{
return i < (i + (-2.0));
}
/* { dg-final { scan-tree-dump-times " = 0" 7 "generic" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */
/* { dg-final { scan-tree-dump-times " = 0" 7 "gimple" } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */

View file

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-fsignaling-nans -fwrapv -fdump-tree-generic" } */
/* { dg-options "-fsignaling-nans -fwrapv -fdump-tree-gimple" } */
int f(int i)
{
return i < (i - 2);
@ -19,5 +19,5 @@ int j (double i)
{
return i > i + 2.0;
}
/* { dg-final { scan-tree-dump-times " = 0" 0 "generic" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */
/* { dg-final { scan-tree-dump-times " = 0" 0 "gimple" } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */

View file

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-ffast-math -fno-wrapv -fdump-tree-generic" } */
/* { dg-options "-ffast-math -fno-wrapv -fdump-tree-gimple" } */
int f(int i)
{
return i >= (i - 2);
@ -29,5 +29,5 @@ int z(double i)
{
return i >= (i + (-2.0));
}
/* { dg-final { scan-tree-dump-times " = 1" 6 "generic" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */
/* { dg-final { scan-tree-dump-times " = 1" 6 "gimple" } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */

View file

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-generic" } */
/* { dg-options "-O2 -fdump-tree-gimple" } */
int
foo (int align)
@ -8,7 +8,7 @@ foo (int align)
return off ? align - off : 0;
}
/* We should have optimized away the mod operator before we genericized
/* We should have optimized away the mod operator before we gimpleized
the code. */
/* { dg-final { scan-tree-dump-times "%" 0 "generic"} } */
/* { dg-final { cleanup-tree-dump "generic" } } */
/* { dg-final { scan-tree-dump-times "%" 0 "gimple"} } */
/* { dg-final { cleanup-tree-dump "gimple" } } */

View file

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-fdump-tree-generic" } */
/* { dg-options "-fdump-tree-gimple" } */
struct f
{
@ -35,8 +35,8 @@ int foobar2(struct g *x)
return &x->k->i == &yy.k->i; /* x->k == yy.k */
}
/* { dg-final { scan-tree-dump-times "x == y" 1 "generic" } } */
/* { dg-final { scan-tree-dump-times "x == &y" 2 "generic" } } */
/* { dg-final { scan-tree-dump "x->k" "generic" } } */
/* { dg-final { scan-tree-dump "yy.k" "generic" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */
/* { dg-final { scan-tree-dump-times "x == y" 1 "gimple" } } */
/* { dg-final { scan-tree-dump-times "x == &y" 2 "gimple" } } */
/* { dg-final { scan-tree-dump "x->k" "gimple" } } */
/* { dg-final { scan-tree-dump "yy.k" "gimple" } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */

View file

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-fdump-tree-generic" } */
/* { dg-options "-fdump-tree-gimple" } */
/* PR tree-optimization/20470:
Missing fold to abs(x) when x == MINUS_EXPR. */
@ -11,5 +11,5 @@ void f1()
i = abs(j-k);
}
/* { dg-final { scan-tree-dump-times "ABS_EXPR" 1 "generic" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */
/* { dg-final { scan-tree-dump-times "ABS_EXPR" 1 "gimple" } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */

View file

@ -212,6 +212,10 @@ build_tree_cfg (tree *tp)
}
}
#ifdef ENABLE_CHECKING
verify_stmts ();
#endif
/* Dump a textual representation of the flowgraph. */
if (dump_file)
dump_tree_cfg (dump_file, dump_flags);

View file

@ -672,7 +672,7 @@ static struct dump_file_info dump_files[TDI_end] =
{".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},
{".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},

View file

@ -566,21 +566,15 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
{
/* Get rid of *& from inline substitutions that can happen when a
pointer argument is an ADDR_EXPR. */
tree decl = TREE_OPERAND (*tp, 0), value;
tree decl = TREE_OPERAND (*tp, 0);
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);
}
*tp = build_fold_indirect_ref ((tree)n->value);
*walk_subtrees = 0;
return NULL;
}
}

View file

@ -57,25 +57,6 @@ bool in_gimple_form;
/* 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
@ -340,7 +321,6 @@ init_tree_optimization_passes (void)
*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);