+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:
+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
/* { 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 ();
/* 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" } } */
/* { dg-do compile } */
-/* { dg-options "-fdump-tree-generic" } */
+/* { dg-options "-fdump-tree-gimple" } */
int f (int a, int b) {
return ~a ^ ~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" } } */
/* { dg-do compile } */
-/* { dg-options "-fdump-tree-generic" } */
+/* { dg-options "-fdump-tree-gimple" } */
int f (int a, int b) {
return ~(a ^ -(b + 1));
}
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" } } */
/* { 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);
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" } } */
/* { 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);
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" } } */
/* { 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);
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" } } */
/* { dg-do compile } */
-/* { dg-options "-fdump-tree-generic" } */
+/* { dg-options "-fdump-tree-gimple" } */
int z (int a) {
return a * -1;
}
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" } } */
/* { 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;
{
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" } } */
/* { dg-do compile } */
-/* { dg-options "-fwrapv -fdump-tree-generic" } */
+/* { dg-options "-fwrapv -fdump-tree-gimple" } */
int f (int i)
{
return (i - 2) > 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" } } */
/* { 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;
{
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" } } */
/* { 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);
{
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" } } */
/* { 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);
{
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" } } */
/* { 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);
{
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" } } */
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-generic" } */
+/* { dg-options "-O2 -fdump-tree-gimple" } */
int
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" } } */
/* { dg-do compile } */
-/* { dg-options "-fdump-tree-generic" } */
+/* { dg-options "-fdump-tree-gimple" } */
struct f
{
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" } } */
/* { 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. */
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" } } */
}
}
+#ifdef ENABLE_CHECKING
+ verify_stmts ();
+#endif
+
/* Dump a textual representation of the flowgraph. */
if (dump_file)
dump_tree_cfg (dump_file, dump_flags);
{".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},
{
/* 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;
}
}
/* 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
*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);