From: Richard Biener Date: Thu, 31 Jan 2013 08:52:56 +0000 (+0000) Subject: re PR tree-optimization/56150 (ICE segfault in do_pre / tail_merge_optimize) X-Git-Tag: upstream/12.2.0~71499 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fcfa87ac3dbb62b8cb32a919711e00d17557fe05;p=platform%2Fupstream%2Fgcc.git re PR tree-optimization/56150 (ICE segfault in do_pre / tail_merge_optimize) 2013-01-31 Richard Biener PR tree-optimization/56150 * tree-ssa-tail-merge.c (gimple_equal_p): Properly handle mixed store non-store stmts. * gcc.dg/torture/pr56150.c: New testcase. From-SVN: r195608 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c93f31d..ae641ef 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-01-30 Richard Biener + + PR tree-optimization/56150 + * tree-ssa-tail-merge.c (gimple_equal_p): Properly handle + mixed store non-store stmts. + 2013-01-30 Jakub Jelinek PR sanitizer/55374 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index edd3d14..2632cd0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-01-30 Richard Biener + + PR tree-optimization/56150 + * gcc.dg/torture/pr56150.c: New testcase. + 2013-01-30 Jakub Jelinek PR sanitizer/55374 diff --git a/gcc/testsuite/gcc.dg/torture/pr56150.c b/gcc/testsuite/gcc.dg/torture/pr56150.c new file mode 100644 index 0000000..6de1115 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr56150.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ + +struct { + int f4; +} g1; + +long g2; + +volatile long g3; + +void func_1 () +{ + if (g2) + g1 = g1; + else + g3; +} diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c index 367a266..b20d306 100644 --- a/gcc/tree-ssa-tail-merge.c +++ b/gcc/tree-ssa-tail-merge.c @@ -1119,17 +1119,14 @@ gimple_equal_p (same_succ same_succ, gimple s1, gimple s2) case GIMPLE_ASSIGN: lhs1 = gimple_get_lhs (s1); lhs2 = gimple_get_lhs (s2); - if (gimple_vdef (s1)) - { - if (vn_valueize (gimple_vdef (s1)) != vn_valueize (gimple_vdef (s2))) - return false; - if (TREE_CODE (lhs1) != SSA_NAME - && TREE_CODE (lhs2) != SSA_NAME) - return true; - } - return (TREE_CODE (lhs1) == SSA_NAME - && TREE_CODE (lhs2) == SSA_NAME - && vn_valueize (lhs1) == vn_valueize (lhs2)); + if (TREE_CODE (lhs1) != SSA_NAME + && TREE_CODE (lhs2) != SSA_NAME) + return (vn_valueize (gimple_vdef (s1)) + == vn_valueize (gimple_vdef (s2))); + else if (TREE_CODE (lhs1) == SSA_NAME + && TREE_CODE (lhs2) == SSA_NAME) + return vn_valueize (lhs1) == vn_valueize (lhs2); + return false; case GIMPLE_COND: t1 = gimple_cond_lhs (s1);