* alpha combine/schedule conflict
@ 1997-10-27 16:30 Richard Henderson
1997-10-28 8:31 ` Jeffrey A Law
[not found] ` <199710280527.VAA04443@cygnus.com>
0 siblings, 2 replies; 6+ messages in thread
From: Richard Henderson @ 1997-10-27 16:30 UTC (permalink / raw)
To: egcs
The attached code produces with -O2
;; Start of basic block 10, registers live: 15 [$15] 30 [$30] 63 [FP] 68 69 72
(insn 553 145 187 (use (reg:DI 133)) -1 (nil)
(expr_list:REG_DEAD (reg:DI 133)
(nil)))
emitted from
#2 0x1201a3048 in distribute_notes () at ../../egcs/gcc/combine.c:11257
#3 0x12017bd84 in try_combine () at ../../egcs/gcc/combine.c:2260
#4 0x120176300 in combine_instructions () at ../../egcs/gcc/combine.c:597
There are no other references to reg 133. Schedule then aborts at
#1 0x1201f4498 in schedule_block () at ../../egcs/gcc/sched.c:3443
because it has a REG_DEAD note it doesn't know what to do with.
What is the correct fix -- teach distribute_notes not to emit the
use if there are no other references to the reg at all, or to teach
schedule_block not to barf?
r~
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: alpha combine/schedule conflict
1997-10-27 16:30 alpha combine/schedule conflict Richard Henderson
@ 1997-10-28 8:31 ` Jeffrey A Law
[not found] ` <199710280527.VAA04443@cygnus.com>
1 sibling, 0 replies; 6+ messages in thread
From: Jeffrey A Law @ 1997-10-28 8:31 UTC (permalink / raw)
To: Richard Henderson; +Cc: egcs
In message < 19971027142124.62972@dot.cygnus.com >you write:
>
> --lrZ03NoBR/3+SXJZ
> Content-Type: text/plain; charset=us-ascii
>
> The attached code produces with -O2
>
> ;; Start of basic block 10, registers live: 15 [$15] 30 [$30] 63 [FP] 68
> 69 72
> (insn 553 145 187 (use (reg:DI 133)) -1 (nil)
> (expr_list:REG_DEAD (reg:DI 133)
> (nil)))
>
> emitted from
>
> #2 0x1201a3048 in distribute_notes () at ../../egcs/gcc/combine.c:11257
> #3 0x12017bd84 in try_combine () at ../../egcs/gcc/combine.c:2260
> #4 0x120176300 in combine_instructions () at ../../egcs/gcc/combine.c:597
>
> There are no other references to reg 133. Schedule then aborts at
>
> #1 0x1201f4498 in schedule_block () at ../../egcs/gcc/sched.c:3443
>
> because it has a REG_DEAD note it doesn't know what to do with.
>
> What is the correct fix -- teach distribute_notes not to emit the
> use if there are no other references to the reg at all, or to teach
> schedule_block not to barf?
This may be related to a problem Jim tried to fix earlier.
Look for "optimization bug" in the Sept archives. There should be messages
from Weiwen Liu, Jim Wilson & myself. Jim had a patch, but apparently it
didn't work.
Jeff
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: alpha combine/schedule conflict
[not found] ` <199710280527.VAA04443@cygnus.com>
@ 1997-10-28 15:42 ` Richard Henderson
1997-11-02 22:27 ` Jeffrey A Law
0 siblings, 1 reply; 6+ messages in thread
From: Richard Henderson @ 1997-10-28 15:42 UTC (permalink / raw)
To: Jim Wilson; +Cc: egcs
On Mon, Oct 27, 1997 at 09:27:50PM -0800, Jim Wilson wrote:
> This is a known problem. Combine is emitting a lot of USE insns that it
> should not be. I tried coming up with a patch, but it is known to be
> incomplete/incorrect.
It looks to me that it solved the USE problem in the test case, but
exposed a new bug also related to REG_DEAD notes. For the test case
I posted at the beginning of this thread I get
(insn 201 199 202 (set (reg/v:DI 71)
(const_int -1)) 252 {movdi-1} (nil)
(nil))
(insn 202 201 205 (set (reg/v:DI 71)
(plus:DI (reg/v:DI 71)
(const_int 536870912))) 7 {adddi3} (insn_list 201 (nil))
(expr_list:REG_DEAD (reg/v:DI 71)
(expr_list:REG_EQUAL (const_int 536870911)
(nil))))
[...]
(insn 209 207 210 (set (reg:DI 137)
(leu:DI (reg:DI 135)
(reg/v:DI 71))) 131 {subdf3+4} (insn_list 202 (insn_list 207 (nil)))
(expr_list:REG_DEAD (reg/v:DI 71)
(nil)))
It appears to be simply due to incomplete checking for elim_i1. The
attached patch (combined with yours because I'm lazy) solves the problem
for the test case. A sanity three-stage is still going, but I'll let
you know.
r~
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: alpha combine/schedule conflict
1997-10-28 15:42 ` Richard Henderson
@ 1997-11-02 22:27 ` Jeffrey A Law
1997-11-02 23:32 ` Richard Henderson
0 siblings, 1 reply; 6+ messages in thread
From: Jeffrey A Law @ 1997-11-02 22:27 UTC (permalink / raw)
To: Richard Henderson; +Cc: Jim Wilson, egcs
In message <19971028111109.02890@dot.cygnus.com>you write:
>
> Tue Oct 28 01:56:39 1997 Richard Henderson <rth@cygnus.com>
>
> * combine.c (try_combine): Don't elim_i1 when it is used in i2src.
>
> Tue Sep 23 12:57:35 1997 Jim Wilson <wilson@cygnus.com>
>
> * combine.c (try_combine): When setting elim_i2, check whether newi2pat
> sets i2dest. When calling distribute_notes for i3dest_killed, pass
> elim_i2 and elim_i1.
Looks good to me. Installed.
jeff
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: alpha combine/schedule conflict
1997-11-02 22:27 ` Jeffrey A Law
@ 1997-11-02 23:32 ` Richard Henderson
1997-11-03 13:53 ` Jeffrey A Law
0 siblings, 1 reply; 6+ messages in thread
From: Richard Henderson @ 1997-11-02 23:32 UTC (permalink / raw)
To: law; +Cc: Richard Henderson, Jim Wilson, egcs
On Sun, Nov 02, 1997 at 11:29:04PM -0700, Jeffrey A Law wrote:
> Looks good to me. Installed.
Actually, that patch isn't; it merely aborts under different
conditions. I've been talking with Jim privately on this one;
we have another patch that seems to work but I was still trying
it on things.
I'll let you know how it turns out tomorrow.
r~
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: alpha combine/schedule conflict
1997-11-02 23:32 ` Richard Henderson
@ 1997-11-03 13:53 ` Jeffrey A Law
0 siblings, 0 replies; 6+ messages in thread
From: Jeffrey A Law @ 1997-11-03 13:53 UTC (permalink / raw)
To: Richard Henderson; +Cc: Jim Wilson, egcs
In message < 19971102233429.46384@dot.cygnus.com >you write:
> On Sun, Nov 02, 1997 at 11:29:04PM -0700, Jeffrey A Law wrote:
> > Looks good to me. Installed.
>
> Actually, that patch isn't; it merely aborts under different
> conditions. I've been talking with Jim privately on this one;
> we have another patch that seems to work but I was still trying
> it on things.
>
> I'll let you know how it turns out tomorrow.
Yow! Well, we're waiting for the updated patch :-)
jeff
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~1997-11-03 13:53 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-10-27 16:30 alpha combine/schedule conflict Richard Henderson
1997-10-28 8:31 ` Jeffrey A Law
[not found] ` <199710280527.VAA04443@cygnus.com>
1997-10-28 15:42 ` Richard Henderson
1997-11-02 22:27 ` Jeffrey A Law
1997-11-02 23:32 ` Richard Henderson
1997-11-03 13:53 ` Jeffrey A Law
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).