On Mon, Aug 14, 2006 at 09:35:34PM +0200, Rask Ingemann Lambertsen wrote:
> On Sun, Aug 13, 2006 at 10:16:02PM +0200, Rask Ingemann Lambertsen wrote:
>
> > Note that right after expand, we have:
> >
> > (note 91 90 0 NOTE_INSN_BASIC_BLOCK)
> >
> > ;; size = size - 1
> > (insn 93 91 96 (set (reg:HI 42)
> > (const_int -1 [0xffffffff])) -1 (nil)
> > (nil))
> >
> > (insn 96 93 97 (parallel [
> > (set (reg:HI 43)
> > (plus:HI (reg/v:HI 32 [ size ])
> > (reg:HI 42)))
> > (clobber (reg:CC 12 cc))
> > ]) -1 (nil)
> > (nil))
> >
> > (insn 97 96 98 (set (reg:HI 43)
> > (reg:HI 43)) -1 (nil)
> > (expr_list:REG_EQUAL (plus:HI (reg/v:HI 32 [ size ])
> > (reg:HI 42))
> > (nil)))
>
> Note that insn 97 is entirely my fault, but ought to be harmless.
>
> > (insn 98 97 0 (set (reg/v:HI 32 [ size ])
> > (reg:HI 43)) -1 (nil)
> > (nil))
> >
> > ;; if (size != 0) goto <L0>; else (void) 0;
> > (insn 100 98 101 10 (set (reg:HI 44)
> > (const_int 0 [0x0])) -1 (nil)
> > (nil))
> >
> > (insn 101 100 102 10 (set (reg:CC 12 cc)
> > (compare:CC (reg/v:HI 32 [ size ])
> > (reg:HI 44))) -1 (nil)
> > (nil))
I changed my addhi3 expander to not output the no-op move insn 97. Now the
RTL comes out just fine:
(note 69 68 0 NOTE_INSN_BASIC_BLOCK)
;; size = size - 1
(insn 71 69 0 (parallel [
(set (reg/v:HI 30 [ size ])
(plus:HI (reg/v:HI 30 [ size ])
(const_int -1 [0xffffffff])))
(clobber (reg:CC 12 cc))
]) -1 (nil)
(nil))
;; if (size != 0) goto <L0>; else (void) 0;
(insn 73 71 74 (set (reg:CC 12 cc)
(compare:CC (reg/v:HI 30 [ size ])
(const_int 0 [0x0]))) -1 (nil)
(nil))
So much for insn 97 being harmless. In optabs.c, expand_binop(), there is a
comment about this (I think):
/* If PAT is composed of more than one insn, try to add an appropriate
REG_EQUAL note to it. If we can't because TEMP conflicts with an
operand, call ourselves again, this time without a target. */
--
Rask Ingemann Lambertsen