* [PATCH] Fix PR52975
@ 2012-04-16 11:01 Richard Guenther
0 siblings, 0 replies; only message in thread
From: Richard Guenther @ 2012-04-16 11:01 UTC (permalink / raw)
To: gcc-patches
This fixes the missed cleanup opportunities from the if-conversion mess.
We should try to produce consistent predicates - thus not do overly
optimistic simplifications on them.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.
Richard.
2012-04-16 Richard Guenther <rguenther@suse.de>
PR tree-optimization/52975
* tree-if-conv.c (predicate_bbs): Do not simplify inverted
condition but always mark it with TRUTH_NOT_EXPR.
Index: gcc/tree-if-conv.c
===================================================================
--- gcc/tree-if-conv.c (revision 186487)
+++ gcc/tree-if-conv.c (working copy)
@@ -968,7 +968,7 @@ predicate_bbs (loop_p loop)
case GIMPLE_COND:
{
- tree c2, tem;
+ tree c2;
edge true_edge, false_edge;
location_t loc = gimple_location (stmt);
tree c = fold_build2_loc (loc, gimple_cond_code (stmt),
@@ -986,10 +986,8 @@ predicate_bbs (loop_p loop)
unshare_expr (c));
/* If C is false, then FALSE_EDGE is taken. */
- c2 = invert_truthvalue_loc (loc, unshare_expr (c));
- tem = canonicalize_cond_expr_cond (c2);
- if (tem)
- c2 = tem;
+ c2 = build1_loc (loc, TRUTH_NOT_EXPR,
+ boolean_type_node, unshare_expr (c));
add_to_dst_predicate_list (loop, false_edge,
unshare_expr (cond), c2);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-04-16 11:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-16 11:01 [PATCH] Fix PR52975 Richard Guenther
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).