Commit 81cfbbc2 by Jan Hubicka Committed by Jan Hubicka

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
parent 618656ff
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> 2005-05-13 J"orn Rennecke <joern.rennecke@st.com>
PR rtl-optimization/20756: PR rtl-optimization/20756:
......
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> 2005-05-11 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/21260 PR fortran/21260
......
/* { dg-do compile } */ /* { 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 f(int);
extern void link_error (); extern void link_error ();
...@@ -46,8 +46,8 @@ main () ...@@ -46,8 +46,8 @@ main ()
/* Check that all instances of __builtin_isnan were folded. */ /* Check that all instances of __builtin_isnan were folded. */
/* { dg-final { scan-tree-dump-times "isnan" 0 "generic" } } */ /* { dg-final { scan-tree-dump-times "isnan" 0 "gimple" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */ /* { dg-final { cleanup-tree-dump "gimple" } } */
/* Check that all instances of link_error were subject to DCE. */ /* Check that all instances of link_error were subject to DCE. */
/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */ /* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-fdump-tree-generic" } */ /* { dg-options "-fdump-tree-gimple" } */
int f (int a, int b) { int f (int a, int b) {
return ~a ^ ~b; return ~a ^ ~b;
...@@ -8,5 +8,5 @@ int f (int a, int b) { ...@@ -8,5 +8,5 @@ int f (int a, int b) {
unsigned int g (unsigned int a, unsigned int b) { unsigned int g (unsigned int a, unsigned int b) {
return ~a ^ ~b; return ~a ^ ~b;
} }
/* { dg-final { scan-tree-dump-times "a \\^ b" 2 "generic" } } */ /* { dg-final { scan-tree-dump-times "a \\^ b" 2 "gimple" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */ /* { dg-final { cleanup-tree-dump "gimple" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-fdump-tree-generic" } */ /* { dg-options "-fdump-tree-gimple" } */
int f (int a, int b) { int f (int a, int b) {
return ~(a ^ -(b + 1)); return ~(a ^ -(b + 1));
} }
...@@ -12,5 +12,5 @@ unsigned int h (unsigned int a, unsigned int b) { ...@@ -12,5 +12,5 @@ unsigned int h (unsigned int a, unsigned int b) {
return ~(-(b + 1) ^ a); return ~(-(b + 1) ^ a);
} }
/* { dg-final { scan-tree-dump-times "b \\^ a" 3 "generic" } } */ /* { dg-final { scan-tree-dump-times "b \\^ a" 3 "gimple" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */ /* { dg-final { cleanup-tree-dump "gimple" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-fdump-tree-generic" } */ /* { dg-options "-fdump-tree-gimple" } */
/* Test for folding abs(x) where appropriate. */ /* Test for folding abs(x) where appropriate. */
#define abs(x) x > 0 ? x : -x #define abs(x) x > 0 ? x : -x
extern double fabs (double); extern double fabs (double);
...@@ -39,5 +39,5 @@ int h (float x) { ...@@ -39,5 +39,5 @@ int h (float x) {
int i (float x) { int i (float x) {
return fabs(x) == -0.0; return fabs(x) == -0.0;
} }
/* { dg-final { scan-tree-dump-times "ABS_EXPR" 0 "generic" } } */ /* { dg-final { scan-tree-dump-times "ABS_EXPR" 0 "gimple" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */ /* { dg-final { cleanup-tree-dump "gimple" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-fdump-tree-generic -ffast-math" } */ /* { dg-options "-fdump-tree-gimple -ffast-math" } */
/* Test for folding abs(x) where appropriate. */ /* Test for folding abs(x) where appropriate. */
#define abs(x) x > 0 ? x : -x #define abs(x) x > 0 ? x : -x
extern double fabs (double); extern double fabs (double);
...@@ -8,5 +8,5 @@ int a (float x) { ...@@ -8,5 +8,5 @@ int a (float x) {
return fabs(x) >= 0.0; return fabs(x) >= 0.0;
} }
/* { dg-final { scan-tree-dump-times "ABS_EXPR" 0 "generic" } } */ /* { dg-final { scan-tree-dump-times "ABS_EXPR" 0 "gimple" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */ /* { dg-final { cleanup-tree-dump "gimple" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* SH4 without -mieee defaults to -ffinite-math-only. */ /* 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. */ /* Test for folding abs(x) where appropriate. */
#define abs(x) x > 0 ? x : -x #define abs(x) x > 0 ? x : -x
extern double fabs (double); extern double fabs (double);
...@@ -9,5 +9,5 @@ int a (float x) { ...@@ -9,5 +9,5 @@ int a (float x) {
return fabs(x) >= 0.0; return fabs(x) >= 0.0;
} }
/* { dg-final { scan-tree-dump-times "ABS_EXPR" 1 "generic" } } */ /* { dg-final { scan-tree-dump-times "ABS_EXPR" 1 "gimple" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */ /* { dg-final { cleanup-tree-dump "gimple" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-fdump-tree-generic" } */ /* { dg-options "-fdump-tree-gimple" } */
int z (int a) { int z (int a) {
return a * -1; return a * -1;
} }
...@@ -11,4 +11,4 @@ int x (int a) { ...@@ -11,4 +11,4 @@ int x (int a) {
int y (int a) { int y (int a) {
return -(-1 * -a); return -(-1 * -a);
} }
/* { dg-final { scan-tree-dump-times "-a" 3 "generic" } } */ /* { dg-final { scan-tree-dump-times "-a" 3 "gimple" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-fno-wrapv -fdump-tree-generic" } */ /* { dg-options "-fno-wrapv -fdump-tree-gimple" } */
int f(int i) int f(int i)
{ {
return (i - 2) > i; return (i - 2) > i;
...@@ -34,5 +34,5 @@ int z(double i) ...@@ -34,5 +34,5 @@ int z(double i)
{ {
return (i + (-2.0)) > i; return (i + (-2.0)) > i;
} }
/* { dg-final { scan-tree-dump-times " = 0" 7 "generic" } } */ /* { dg-final { scan-tree-dump-times " = 0" 7 "gimple" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */ /* { dg-final { cleanup-tree-dump "gimple" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-fwrapv -fdump-tree-generic" } */ /* { dg-options "-fwrapv -fdump-tree-gimple" } */
int f (int i) int f (int i)
{ {
return (i - 2) > i; return (i - 2) > i;
...@@ -14,5 +14,5 @@ int h (double i) ...@@ -14,5 +14,5 @@ int h (double i)
{ {
return (i + 2.0) <= i; return (i + 2.0) <= i;
} }
/* { dg-final { scan-tree-dump-times " = 0" 0 "generic" } } */ /* { dg-final { scan-tree-dump-times " = 0" 0 "gimple" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */ /* { dg-final { cleanup-tree-dump "gimple" } } */
/* { dg-do compile } */ /* { 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) int f(int i)
{ {
return (i - 2) <= i; return (i - 2) <= i;
...@@ -29,5 +29,5 @@ int z(double i) ...@@ -29,5 +29,5 @@ int z(double i)
{ {
return (i + (-2.0)) <= i; return (i + (-2.0)) <= i;
} }
/* { dg-final { scan-tree-dump-times " = 1" 6 "generic" } } */ /* { dg-final { scan-tree-dump-times " = 1" 6 "gimple" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */ /* { dg-final { cleanup-tree-dump "gimple" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-fno-wrapv -fdump-tree-generic" } */ /* { dg-options "-fno-wrapv -fdump-tree-gimple" } */
int f(int i) int f(int i)
{ {
return i < (i - 2); return i < (i - 2);
...@@ -34,5 +34,5 @@ int z(double i) ...@@ -34,5 +34,5 @@ int z(double i)
{ {
return i < (i + (-2.0)); return i < (i + (-2.0));
} }
/* { dg-final { scan-tree-dump-times " = 0" 7 "generic" } } */ /* { dg-final { scan-tree-dump-times " = 0" 7 "gimple" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */ /* { dg-final { cleanup-tree-dump "gimple" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-fsignaling-nans -fwrapv -fdump-tree-generic" } */ /* { dg-options "-fsignaling-nans -fwrapv -fdump-tree-gimple" } */
int f(int i) int f(int i)
{ {
return i < (i - 2); return i < (i - 2);
...@@ -19,5 +19,5 @@ int j (double i) ...@@ -19,5 +19,5 @@ int j (double i)
{ {
return i > i + 2.0; return i > i + 2.0;
} }
/* { dg-final { scan-tree-dump-times " = 0" 0 "generic" } } */ /* { dg-final { scan-tree-dump-times " = 0" 0 "gimple" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */ /* { dg-final { cleanup-tree-dump "gimple" } } */
/* { dg-do compile } */ /* { 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) int f(int i)
{ {
return i >= (i - 2); return i >= (i - 2);
...@@ -29,5 +29,5 @@ int z(double i) ...@@ -29,5 +29,5 @@ int z(double i)
{ {
return i >= (i + (-2.0)); return i >= (i + (-2.0));
} }
/* { dg-final { scan-tree-dump-times " = 1" 6 "generic" } } */ /* { dg-final { scan-tree-dump-times " = 1" 6 "gimple" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */ /* { dg-final { cleanup-tree-dump "gimple" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-generic" } */ /* { dg-options "-O2 -fdump-tree-gimple" } */
int int
foo (int align) foo (int align)
...@@ -8,7 +8,7 @@ foo (int align) ...@@ -8,7 +8,7 @@ foo (int align)
return off ? align - off : 0; 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. */ the code. */
/* { dg-final { scan-tree-dump-times "%" 0 "generic"} } */ /* { dg-final { scan-tree-dump-times "%" 0 "gimple"} } */
/* { dg-final { cleanup-tree-dump "generic" } } */ /* { dg-final { cleanup-tree-dump "gimple" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-fdump-tree-generic" } */ /* { dg-options "-fdump-tree-gimple" } */
struct f struct f
{ {
...@@ -35,8 +35,8 @@ int foobar2(struct g *x) ...@@ -35,8 +35,8 @@ int foobar2(struct g *x)
return &x->k->i == &yy.k->i; /* x->k == yy.k */ 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" 1 "gimple" } } */
/* { dg-final { scan-tree-dump-times "x == &y" 2 "generic" } } */ /* { dg-final { scan-tree-dump-times "x == &y" 2 "gimple" } } */
/* { dg-final { scan-tree-dump "x->k" "generic" } } */ /* { dg-final { scan-tree-dump "x->k" "gimple" } } */
/* { dg-final { scan-tree-dump "yy.k" "generic" } } */ /* { dg-final { scan-tree-dump "yy.k" "gimple" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */ /* { dg-final { cleanup-tree-dump "gimple" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-fdump-tree-generic" } */ /* { dg-options "-fdump-tree-gimple" } */
/* PR tree-optimization/20470: /* PR tree-optimization/20470:
Missing fold to abs(x) when x == MINUS_EXPR. */ Missing fold to abs(x) when x == MINUS_EXPR. */
...@@ -11,5 +11,5 @@ void f1() ...@@ -11,5 +11,5 @@ void f1()
i = abs(j-k); i = abs(j-k);
} }
/* { dg-final { scan-tree-dump-times "ABS_EXPR" 1 "generic" } } */ /* { dg-final { scan-tree-dump-times "ABS_EXPR" 1 "gimple" } } */
/* { dg-final { cleanup-tree-dump "generic" } } */ /* { dg-final { cleanup-tree-dump "gimple" } } */
...@@ -212,6 +212,10 @@ build_tree_cfg (tree *tp) ...@@ -212,6 +212,10 @@ build_tree_cfg (tree *tp)
} }
} }
#ifdef ENABLE_CHECKING
verify_stmts ();
#endif
/* Dump a textual representation of the flowgraph. */ /* Dump a textual representation of the flowgraph. */
if (dump_file) if (dump_file)
dump_tree_cfg (dump_file, dump_flags); dump_tree_cfg (dump_file, dump_flags);
......
...@@ -672,7 +672,7 @@ static struct dump_file_info dump_files[TDI_end] = ...@@ -672,7 +672,7 @@ static struct dump_file_info dump_files[TDI_end] =
{".tu", "translation-unit", NULL, TDF_TREE, 0, 0, 0}, {".tu", "translation-unit", NULL, TDF_TREE, 0, 0, 0},
{".class", "class-hierarchy", NULL, TDF_TREE, 0, 1, 0}, {".class", "class-hierarchy", NULL, TDF_TREE, 0, 1, 0},
{".original", "tree-original", NULL, TDF_TREE, 0, 2, 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}, {".nested", "tree-nested", NULL, TDF_TREE, 0, 4, 0},
{".inlined", "tree-inlined", NULL, TDF_TREE, 0, 5, 0}, {".inlined", "tree-inlined", NULL, TDF_TREE, 0, 5, 0},
{".vcg", "tree-vcg", NULL, TDF_TREE, 0, 6, 0}, {".vcg", "tree-vcg", NULL, TDF_TREE, 0, 6, 0},
......
...@@ -566,21 +566,15 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data) ...@@ -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 /* Get rid of *& from inline substitutions that can happen when a
pointer argument is an ADDR_EXPR. */ pointer argument is an ADDR_EXPR. */
tree decl = TREE_OPERAND (*tp, 0), value; tree decl = TREE_OPERAND (*tp, 0);
splay_tree_node n; splay_tree_node n;
n = splay_tree_lookup (id->decl_map, (splay_tree_key) decl); n = splay_tree_lookup (id->decl_map, (splay_tree_key) decl);
if (n) if (n)
{ {
value = (tree) n->value; *tp = build_fold_indirect_ref ((tree)n->value);
STRIP_NOPS (value); *walk_subtrees = 0;
if (TREE_CODE (value) == ADDR_EXPR return NULL;
&& (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);
}
} }
} }
......
...@@ -57,25 +57,6 @@ bool in_gimple_form; ...@@ -57,25 +57,6 @@ bool in_gimple_form;
/* The root of the compilation pass tree, once constructed. */ /* The root of the compilation pass tree, once constructed. */
static struct tree_opt_pass *all_passes, *all_ipa_passes; 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. */ /* Gate: execute, or not, all of the non-trivial optimizations. */
static bool static bool
...@@ -340,7 +321,6 @@ init_tree_optimization_passes (void) ...@@ -340,7 +321,6 @@ init_tree_optimization_passes (void)
*p = NULL; *p = NULL;
p = &all_passes; p = &all_passes;
NEXT_PASS (pass_gimple);
NEXT_PASS (pass_remove_useless_stmts); NEXT_PASS (pass_remove_useless_stmts);
NEXT_PASS (pass_mudflap_1); NEXT_PASS (pass_mudflap_1);
NEXT_PASS (pass_lower_cf); NEXT_PASS (pass_lower_cf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment