From: Andrey Belevantsev Date: Tue, 3 Jun 2014 09:20:36 +0000 (+0400) Subject: backport: re PR rtl-optimization/60901 (ICE: SIGSEGV in add_to_deps_list with -fsel... X-Git-Tag: releases/gcc-4.8.4~435 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af069f5f894ea97c973e20d960fbb6e65f33fae4;p=thirdparty%2Fgcc.git backport: re PR rtl-optimization/60901 (ICE: SIGSEGV in add_to_deps_list with -fsel-sched-pipelining-outer-loops) Backport from mainline 2014-05-14 Andrey Belevantsev PR rtl-optimization/60901 * config/i386/i386.c (ix86_dependencies_evaluation_hook): Check that bb predecessor belongs to the same scheduling region. Adjust comment. * gcc.target/i386/pr60901.c: New test. From-SVN: r211164 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d2b035200398..278e13316cd9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2014-06-03 Andrey Belevantsev + + Backport from mainline + 2014-05-14 Andrey Belevantsev + + PR rtl-optimization/60901 + * config/i386/i386.c (ix86_dependencies_evaluation_hook): Check that + bb predecessor belongs to the same scheduling region. Adjust comment. + 2014-06-03 Uros Bizjak Backport from mainline diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index fa81d0fbbefc..4ad76bd7fcca 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -24640,13 +24640,17 @@ ix86_dependencies_evaluation_hook (rtx head, rtx tail) { edge e; edge_iterator ei; - /* Assume that region is SCC, i.e. all immediate predecessors - of non-head block are in the same region. */ + + /* Regions are SCCs with the exception of selective + scheduling with pipelining of outer blocks enabled. + So also check that immediate predecessors of a non-head + block are in the same region. */ FOR_EACH_EDGE (e, ei, bb->preds) { /* Avoid creating of loop-carried dependencies through - using topological odering in region. */ - if (BLOCK_TO_BB (bb->index) > BLOCK_TO_BB (e->src->index)) + using topological ordering in the region. */ + if (rgn == CONTAINING_RGN (e->src->index) + && BLOCK_TO_BB (bb->index) > BLOCK_TO_BB (e->src->index)) add_dependee_for_func_arg (first_arg, e->src); } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index da44bda52ffd..a165e84e458a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2014-06-03 Andrey Belevantsev + + Backport from mainline + 2014-05-14 Andrey Belevantsev + + PR rtl-optimization/60901 + * gcc.target/i386/pr60901.c: New test. + 2014-05-28 Eric Botcazou Backport from mainline diff --git a/gcc/testsuite/gcc.target/i386/pr60901.c b/gcc/testsuite/gcc.target/i386/pr60901.c new file mode 100644 index 000000000000..f0f25a1dc2c7 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr60901.c @@ -0,0 +1,17 @@ +/* { dg-options "-O -fselective-scheduling -fschedule-insns -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -fno-tree-dominator-opts" } */ + +extern int n; +extern void bar (void); +extern int baz (int); + +void +foo (void) +{ + int i, j; + for (j = 0; j < n; j++) + { + for (i = 1; i < j; i++) + bar (); + baz (0); + } +}