aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2013-04-02 20:29:18 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2013-04-02 20:29:18 +0200
commit09bb4c99b03944e4910975593a80dcf1545886ff (patch)
tree346ed796a8eef256e6eab10dfeb1fe9bbb51748c
parenta1d8947aa1168fac70052d1d7d8b64dde934de8d (diff)
downloadgcc-09bb4c99b03944e4910975593a80dcf1545886ff.zip
gcc-09bb4c99b03944e4910975593a80dcf1545886ff.tar.gz
gcc-09bb4c99b03944e4910975593a80dcf1545886ff.tar.bz2
re PR rtl-optimization/56745 (ICE in merge_if_block)
PR rtl-optimization/56745 * ifcvt.c (cond_exec_find_if_block): Don't try to optimize if then_bb has no successors and else_bb is EXIT_BLOCK_PTR. * gcc.c-torture/compile/pr56745.c: New test. From-SVN: r197371
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/ifcvt.c2
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr56745.c15
4 files changed, 26 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 81321f67..3368116 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2013-04-02 Jakub Jelinek <jakub@redhat.com>
+ PR rtl-optimization/56745
+ * ifcvt.c (cond_exec_find_if_block): Don't try to optimize
+ if then_bb has no successors and else_bb is EXIT_BLOCK_PTR.
+
PR c++/34949
* tree-ssa-alias.c (stmt_kills_ref_p_1): If base != ref->base
and both of them are MEM_REFs, just compare first argument for
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index f081ecd..faea882 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -3473,7 +3473,7 @@ cond_exec_find_if_block (struct ce_if_block * ce_info)
code processing. ??? we should fix this in the future. */
if (EDGE_COUNT (then_bb->succs) == 0)
{
- if (single_pred_p (else_bb))
+ if (single_pred_p (else_bb) && else_bb != EXIT_BLOCK_PTR)
{
rtx last_insn = BB_END (then_bb);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 63dc3e0..6f120f2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,4 +1,9 @@
-2013-04-02 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
+2013-04-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/56745
+ * gcc.c-torture/compile/pr56745.c: New test.
+
+2013-04-02 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
* gcc.dg/tree-ssa/sra-13.c: Fix for 16 bit int.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr56745.c b/gcc/testsuite/gcc.c-torture/compile/pr56745.c
new file mode 100644
index 0000000..ee9ba051
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr56745.c
@@ -0,0 +1,15 @@
+/* PR rtl-optimization/56745 */
+
+unsigned char a[6];
+
+void
+foo ()
+{
+ int i;
+ for (i = 5; i >= 0; i++)
+ {
+ if (++a[i] != 0)
+ break;
+ ++a[i];
+ }
+}