From: rguenth Date: Sun, 27 Jun 2010 11:16:46 +0000 (+0000) Subject: 2010-06-27 Richard Guenther X-Git-Tag: upstream/4.9.2~28329 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2253ffcaf24f7d2b7b5b0858ee29a648a49358d0;p=platform%2Fupstream%2Flinaro-gcc.git 2010-06-27 Richard Guenther PR tree-optimization/44683 * tree-ssa-dom.c (record_edge_info): Record equivalences for the false edge from the inverted condition. * gcc.c-torture/execute/pr44683.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161467 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1281858..5a6908c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2010-06-27 Richard Guenther + PR tree-optimization/44683 + * tree-ssa-dom.c (record_edge_info): Record equivalences for the + false edge from the inverted condition. + +2010-06-27 Richard Guenther + PR middle-end/44684 * tree-ssa-alias.c (refs_may_alias_p_1): Allow SSA name refs. (stmt_may_clobber_ref_p_1): Do not bother to call the oracle diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 04fad30..75a47a2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-06-27 Richard Guenther + + PR tree-optimization/44683 + * gcc.c-torture/execute/pr44683.c: New testcase. + 2010-06-27 Eric Botcazou * gnat.dg/noreturn3.ad[sb]: New test. diff --git a/gcc/testsuite/gcc.c-torture/execute/pr44683.c b/gcc/testsuite/gcc.c-torture/execute/pr44683.c new file mode 100644 index 0000000..d0fd446 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr44683.c @@ -0,0 +1,18 @@ +int __attribute__((noinline,noclone)) +copysign_bug (double x) +{ + if (x != 0.0 && (x * 0.5 == x)) + return 1; + if (__builtin_copysign(1.0, x) < 0.0) + return 2; + else + return 3; +} +int main(void) +{ + double x = -0.0; + if (copysign_bug (x) != 2) + __builtin_abort (); + return 0; +} + diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c index d15df31..6833820 100644 --- a/gcc/tree-ssa-dom.c +++ b/gcc/tree-ssa-dom.c @@ -1635,7 +1635,7 @@ record_edge_info (basic_block bb) edge_info = allocate_edge_info (false_edge); record_conditions (edge_info, inverted, cond); - if (code == NE_EXPR) + if (TREE_CODE (inverted) == EQ_EXPR) { edge_info->lhs = op1; edge_info->rhs = op0; @@ -1662,7 +1662,7 @@ record_edge_info (basic_block bb) edge_info = allocate_edge_info (false_edge); record_conditions (edge_info, inverted, cond); - if (TREE_CODE (cond) == NE_EXPR) + if (TREE_CODE (inverted) == EQ_EXPR) { edge_info->lhs = op0; edge_info->rhs = op1;