This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Scheduling fix (fixes gcc.c-torture/execute/980506-1.c on ppc)
- To: Geoff Keating <geoffk at ozemail dot com dot au>
- Subject: Re: Scheduling fix (fixes gcc.c-torture/execute/980506-1.c on ppc)
- From: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Date: Tue, 25 Aug 1998 16:52:57 +0200
- Cc: egcs-patches at cygnus dot com
At 05:24 25.08.98 , Geoff Keating wrote:
>
>The testcase, under '-O -fsched-verbose-9 -fschedule-insns', generates
>RTL like the following:
>
>;; Function clear_modes
>
>...
>
>;; Start of basic block 2, registers live: 1 [1] 31 [31] 81 84
>(code_label 16 15 18 2 ("blah"))
>
>(note 18 16 19 "" NOTE_INSN_DELETED)
>
>(jump_insn 19 18 0 (set (pc)
> (if_then_else (ne (reg:CC 84)
> (const_int 0))
> (label_ref 11)
> (pc))) 634 {jump-4} (nil)
> (nil))
>;; End of basic block 2
>
>
>;; Function main
>
>...
>
>
>Now, basic block 2 has two exits. One exit goes back to basic block
>1. The other goes off the edge of the procedure. Unfortunately,
>haifa only notices the first one, because the second exit doesn't go
>to any basic block, and thinks basic block 2 has only one exit; so the
>branch must be taken with 100% probability:
>
>;; ------------ REGIONS ----------
>
>;; rgn 0 nr_blocks 2:
>;; bb/block: 0/2 1/1
>
>;; rgn 1 nr_blocks 1:
>;; bb/block: 0/0
>
>;; bb_prob(1, 1) = 100
>
>For the test case, the branch is actually 0% probability, and haifa
>then mis-schedules the procedure.
>
>If the fix below is not acceptable, then you must go through
>haifa-sched.c and fix every place where it examines the flow graph
>(that is, everywhere in haifa-sched.c) to allow for blocks like block
>2 in the above. The immediate problem is in compute_dom_prob_ps.
Hi Geoff,
is this patch needed in addition to this one:
Tue Aug 18 10:32:11 1998 Jeffrey A Law (law@cygnus.com)
* haifa-sched.c (sched_analyze): Put all JUMP_INSNs on the last
pending memory flush list.
This patch alone fixed 980506-1.c for me and others. Doesn't it fix all
possible cases?
Franz.