Commit 3aef2dbd by Richard Guenther Committed by Richard Biener

re PR tree-optimization/30965 (Fails to tree-combine conditions in COND_EXPRs)

2007-04-27  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/30965
	PR tree-optimization/30978
	* Makefile.in (tree-ssa-forwprop.o): Depend on $(FLAGS_H).
        * tree-ssa-forwprop.c (forward_propagate_into_cond_1): Remove.
        (find_equivalent_equality_comparison): Likewise.
        (simplify_cond): Likewise.
        (get_prop_source_stmt): New helper.
        (get_prop_dest_stmt): Likewise.
	(can_propagate_from): Likewise.
	(remove_prop_source_from_use): Likewise.
        (combine_cond_expr_cond): Likewise.
        (forward_propagate_comparison): New function.
        (forward_propagate_into_cond): Rewrite to use fold for
        tree combining.
	(tree_ssa_forward_propagate_single_use_vars): Call
	forward_propagate_comparison to propagate comparisons.

	* gcc.dg/tree-ssa/pr30978.c: New testcase.
	* gcc.dg/tree-ssa/bool-3.c: Remove XFAIL, explain why.
	* gcc.dg/tree-ssa/ssa-fre-4.c: Use char instead of bool
	* gcc.dg/strict-overflow-5.c: Adjust tree dump scanning.

From-SVN: r124217
parent 891fc5e9
2007-04-27 Richard Guenther <rguenther@suse.de>
PR tree-optimization/30965
PR tree-optimization/30978
* Makefile.in (tree-ssa-forwprop.o): Depend on $(FLAGS_H).
* tree-ssa-forwprop.c (forward_propagate_into_cond_1): Remove.
(find_equivalent_equality_comparison): Likewise.
(simplify_cond): Likewise.
(get_prop_source_stmt): New helper.
(get_prop_dest_stmt): Likewise.
(can_propagate_from): Likewise.
(remove_prop_source_from_use): Likewise.
(combine_cond_expr_cond): Likewise.
(forward_propagate_comparison): New function.
(forward_propagate_into_cond): Rewrite to use fold for
tree combining.
(tree_ssa_forward_propagate_single_use_vars): Call
forward_propagate_comparison to propagate comparisons.
2007-04-27 Richard Guenther <rguenther@suse.de>
PR tree-optimization/31715
* tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Make
sure to do computation on the offset in an appropriate
......
......@@ -1934,7 +1934,7 @@ tree-ssa-dse.o : tree-ssa-dse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
tree-ssa-forwprop.o : tree-ssa-forwprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_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) \
langhooks.h
langhooks.h $(FLAGS_H)
tree-ssa-phiopt.o : tree-ssa-phiopt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_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) \
......
2007-04-27 Richard Guenther <rguenther@suse.de>
PR tree-optimization/30965
PR tree-optimization/30978
* gcc.dg/tree-ssa/pr30978.c: New testcase.
* gcc.dg/tree-ssa/bool-3.c: Remove XFAIL, explain why.
* gcc.dg/tree-ssa/ssa-fre-4.c: Use char instead of bool
* gcc.dg/strict-overflow-5.c: Adjust tree dump scanning.
2007-04-27 Richard Guenther <rguenther@suse.de>
PR tree-optimization/31715
* gcc.dg/Warray-bounds-4.c: New testcase.
/* { dg-do compile } */
/* { dg-options "-fstrict-overflow -O2 -fdump-tree-final_cleanup" } */
/* { dg-options "-fstrict-overflow -O2 -fdump-tree-optimized" } */
/* We can only unroll when using strict overflow semantics. */
......@@ -14,6 +14,6 @@ int foo (int i)
return r;
}
/* { dg-final { scan-tree-dump-times "r = 3" 1 "final_cleanup" } } */
/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
/* { dg-final { scan-tree-dump "return 3" "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
......@@ -11,8 +11,8 @@ int f(_Bool x)
return y;
}
/* There should be no == 0. Though PHI-OPT or invert_truth does not
fold its tree. */
/* { dg-final { scan-tree-dump-times "== 0" 0 "optimized" { xfail *-*-* } } } */
/* There should be no == 0. Though PHI-OPT or invert_truth does not
fold its tree forwprop is able to clean up the mess. */
/* { dg-final { scan-tree-dump-times "== 0" 0 "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-optimized" } */
int foo(int a)
{
unsigned int b = a > 0;
char c = b;
_Bool d = c == 0;
int e = !d;
return e;
}
/* { dg-final { scan-tree-dump "return a > 0;" "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
......@@ -3,13 +3,12 @@
/* From PR21608. */
#define bool _Bool
static inline bool wrap(bool f) { return f; }
bool bar(bool f)
static inline char wrap(char f) { return f; }
char bar(char f)
{
return wrap(f);
}
/* { dg-final { scan-tree-dump "Replaced \\\(_Bool\\\) .*with " "fre" } } */
/* { dg-final { scan-tree-dump "Replaced \\\(char\\\) .*with " "fre" } } */
/* { dg-final { scan-tree-dump "Replaced \\\(int\\\) .*with " "fre" } } */
/* { dg-final { cleanup-tree-dump "fre" } } */
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