This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, ice, selective scheduler] Patch for PR 41697
- From: Andrey Belevantsev <abel at ispras dot ru>
- To: sje at cup dot hp dot com
- Cc: gcc-patches at gcc dot gnu dot org, "Vladimir N. Makarov" <vmakarov at redhat dot com>
- Date: Thu, 12 Nov 2009 16:22:33 +0300
- Subject: Re: [patch, ice, selective scheduler] Patch for PR 41697
- References: <200910141757.n9EHvr924094@lucas.cup.hp.com> <4AD625EA.9080701@ispras.ru> <4AD6EE09.3050009@ispras.ru>
Hello,
Andrey Belevantsev wrote:
Andrey Belevantsev wrote:
Hi Steve,
Steve Ellcey wrote:
This patch fixes an ICE on IA64 with the testcase
gcc.c-torture/compile/20090917-1.c. That test will generate an ICE in
the selective scheduler because we try to access the successor to a
basic block before verifying that the basic block has any successors.
This patch adds a check and fixes the ICE.
I have missed the second instance of this issue that can be seen when
using selective scheduler on the above test with -O2. The problem is
that a block ending on a conditional jump has a single successor, thus
using FALLTHRU_EDGE on it like in fallthru_bb_of_jump crashes. The
following simple patch avoids this. Is it ok for trunk? The patch is
safe, and the bug technically is probably a regression, though I don't
have a 4.4.x build on ia64 to back up this.
Bootstrapped and tested on ia64 with sel-sched enabled at -O2.
Andrey
2009-11-12 Andrey Belevantsev <abel@ispras.ru>
PR rtl-optimization/41697
* sel-sched-ir.c (fallthru_bb_of_jump): Bail out when a block with a
conditional jump has a single successor.
Index: gcc/sel-sched-ir.c
===================================================================
*** gcc/sel-sched-ir.c (revision 154088)
--- gcc/sel-sched-ir.c (working copy)
*************** fallthru_bb_of_jump (rtx jump)
*** 4290,4295 ****
--- 4290,4300 ----
if (!any_condjump_p (jump))
return NULL;
+ /* A basic block that ends with a conditional jump may still have
one successor
+ (and be followed by a barrier), we are not interested. */
+ if (single_succ_p (BLOCK_FOR_INSN (jump)))
+ return NULL;
+
return FALLTHRU_EDGE (BLOCK_FOR_INSN (jump))->dest;
}