Commit a564d0f1 by Jeff Law Committed by Jeff Law

Makefile.in (tree-ssa-forwprop.o): Depend on langhooks.h.


	* Makefile.in (tree-ssa-forwprop.o): Depend on langhooks.h.
	* tree-ssa-forwprop.c: Include langhooks.h.
	(forward_propagate_addr_expr_into_variable_array_index): New.
	(forward_propagate_addr_expr): New.
	(tree_ssa_forward_propagate_single_use_vars): Loop over all
	the statements in the block instead of just the last statement.
	Call forward_propagate_addr_expr as needed.
	(pass_forwprop): Update the SSA graph after forward propagation is
	complete.

	* g++.dg/tree-ssa/pr18414.C: New test.
	* gcc.dg/tree-ssa/pr18414.C: New test.
	* gcc.dg/tree-ssa/pr17141-1.C: New test.
	* gcc.dg/tree-ssa/pr17141-2.C: New test.

From-SVN: r99837
parent 79d0dfa3
2005-05-17 Jeff Law <law@redhat.com>
* Makefile.in (tree-ssa-forwprop.o): Depend on langhooks.h.
* tree-ssa-forwprop.c: Include langhooks.h.
(forward_propagate_addr_expr_into_variable_array_index): New.
(forward_propagate_addr_expr): New.
(tree_ssa_forward_propagate_single_use_vars): Loop over all
the statements in the block instead of just the last statement.
Call forward_propagate_addr_expr as needed.
(pass_forwprop): Update the SSA graph after forward propagation is
complete.
2005-05-17 Nathan Sidwell <nathan@codesourcery.com>
* unwind-dw2-fde-glibc.c (base_from_cb_data,
......
......@@ -1665,7 +1665,8 @@ tree-ssa-dse.o : tree-ssa-dse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(DIAGNOSTIC_H) $(TIMEVAR_H)
tree-ssa-forwprop.o : tree-ssa-forwprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) errors.h $(GGC_H) $(TREE_H) $(RTL_H) $(TM_P_H) $(BASIC_BLOCK_H) \
$(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) $(DIAGNOSTIC_H) $(TIMEVAR_H)
$(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \
langhooks.h
tree-ssa-phiopt.o : tree-ssa-phiopt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) errors.h $(GGC_H) $(TREE_H) $(RTL_H) $(TM_P_H) $(BASIC_BLOCK_H) \
$(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) langhooks.h $(FLAGS_H) \
......
2005-05-17 Jeff Law <law@redhat.com>
* g++.dg/tree-ssa/pr18414.C: New test.
* gcc.dg/tree-ssa/pr18414.C: New test.
* gcc.dg/tree-ssa/pr17141-1.C: New test.
* gcc.dg/tree-ssa/pr17141-2.C: New test.
2005-05-17 Richard Guenther <rguenth@gcc.gnu.org>
* gcc.dg/compat/generate-random.c: Do not include
......
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-forwprop2" } */
class YY { public:
YY(const YY &v) { e[0] = v.e[0]; e[1] = v.e[1]; e[2] = v.e[2]; }
double &y() { return e[1]; }
double e[3]; };
class XX { public:
YY direction() const { return v; }
YY v; };
int foo(XX& r) {
if (r.direction().y() < 0.000001) return 0;
return 1; }
/* { dg-final { scan-tree-dump-times "&this" 0 "forwprop2" } } */
/* { dg-final { scan-tree-dump-times "&r" 0 "forwprop2" } } */
/* { dg-final { cleanup-tree-dump "forwprop2" } } */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-forwprop2" } */
struct YY {
double e[3]; };
static inline double *y(struct YY* this_1) { return &this_1->e[1]; }
struct XX {
struct YY v;
};
static inline struct YY direction (const struct XX* this_1) { return this_1->v;}
int foo(const struct XX* r) {
struct YY t = direction(r);
if (*y(&t) < 0.000001) return 0;
return 1;
}
/* { dg-final { scan-tree-dump-times "&" 0 "forwprop2" } } */
/* { dg-final { cleanup-tree-dump "forwprop2" } } */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-forwprop2" } */
struct A { int i; };
int
foo(struct A *locp, int str)
{
int T355, *T356;
T356 = &locp->i;
*T356 = str;
return locp->i;
}
/* { dg-final { scan-tree-dump-times "&" 0 "forwprop2" } } */
/* { dg-final { cleanup-tree-dump "forwprop2" } } */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
void abort (void);
struct a
{
int i;
} *a;
int f(void)
{
int *ii = &a->i;
void *l;
a->i = 1;
if (*ii)
l = &&l1;
else
l = &&l2;
goto *l;
l1:
return 0;
l2:
abort ();
}
/* { dg-final { scan-tree-dump-times "&" 0 "optimized" } } */
/* { dg-final { scan-tree-dump-times "abort" 0 "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
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