mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-25 06:50:26 +08:00
tree-ssa-dom.c (build_and_record_new_cond): Add optional parameter to record a condition that is false.
2015-07-02 Richard Biener <rguenther@suse.de> * tree-ssa-dom.c (build_and_record_new_cond): Add optional parameter to record a condition that is false. (record_conditions): When recording an extra NE_EXPR that is true also record a EQ_EXPR that is false. * gcc.dg/tree-ssa/ssa-dom-cse-4.c: New testcase. From-SVN: r225299
This commit is contained in:
parent
53ac92c3e0
commit
a003896684
gcc
@ -1,3 +1,10 @@
|
||||
2015-07-02 Richard Biener <rguenther@suse.de>
|
||||
|
||||
* tree-ssa-dom.c (build_and_record_new_cond): Add optional
|
||||
parameter to record a condition that is false.
|
||||
(record_conditions): When recording an extra NE_EXPR that is
|
||||
true also record a EQ_EXPR that is false.
|
||||
|
||||
2015-07-02 Bin Cheng <bin.cheng@arm.com>
|
||||
|
||||
* tree-ssa-loop-ivopts.c (struct ivopts_data): New field iv_obstack.
|
||||
|
@ -1,3 +1,7 @@
|
||||
2015-07-02 Richard Biener <rguenther@suse.de>
|
||||
|
||||
* gcc.dg/tree-ssa/ssa-dom-cse-4.c: New testcase.
|
||||
|
||||
2015-07-01 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* gcc.target/i386/mpx/pr66568.c (exit): New prototype.
|
||||
|
20
gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-4.c
Normal file
20
gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-4.c
Normal file
@ -0,0 +1,20 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O -fdump-tree-optimized" } */
|
||||
|
||||
extern void abort (void);
|
||||
|
||||
unsigned int
|
||||
foo (unsigned int x, unsigned int y)
|
||||
{
|
||||
unsigned int z;
|
||||
|
||||
if (x >= y)
|
||||
return 1;
|
||||
|
||||
if (y == x)
|
||||
abort ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* { dg-final { scan-tree-dump-not "abort" "optimized" } } */
|
@ -813,7 +813,8 @@ free_all_edge_infos (void)
|
||||
static void
|
||||
build_and_record_new_cond (enum tree_code code,
|
||||
tree op0, tree op1,
|
||||
vec<cond_equivalence> *p)
|
||||
vec<cond_equivalence> *p,
|
||||
bool val = true)
|
||||
{
|
||||
cond_equivalence c;
|
||||
struct hashable_expr *cond = &c.cond;
|
||||
@ -826,7 +827,7 @@ build_and_record_new_cond (enum tree_code code,
|
||||
cond->ops.binary.opnd0 = op0;
|
||||
cond->ops.binary.opnd1 = op1;
|
||||
|
||||
c.value = boolean_true_node;
|
||||
c.value = val ? boolean_true_node : boolean_false_node;
|
||||
p->safe_push (c);
|
||||
}
|
||||
|
||||
@ -865,6 +866,8 @@ record_conditions (struct edge_info *edge_info, tree cond, tree inverted)
|
||||
op0, op1, &edge_info->cond_equivalences);
|
||||
build_and_record_new_cond (NE_EXPR, op0, op1,
|
||||
&edge_info->cond_equivalences);
|
||||
build_and_record_new_cond (EQ_EXPR, op0, op1,
|
||||
&edge_info->cond_equivalences, false);
|
||||
break;
|
||||
|
||||
case GE_EXPR:
|
||||
|
Loading…
x
Reference in New Issue
Block a user