This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Split edge fails when performed on a doloop jump on x86 port


Jim Wilson <wilson@specifixinc.com> wrote on 18/02/2004 21:58:35:

> Mostafa Hagog wrote:
> >             (set (pc)
> >                 (if_then_else (ne (reg:SI 0 ax)
> >                         (const_int 1 [0x1]))
> >                     (label_ref 419)
> >                     (pc)))
> >             (set (mem:SI (plus:SI (reg/f:SI 7 sp)
> >                         (const_int 4 [0x4])) [12 S4 A8])
> >                 (plus:SI (reg:SI 0 ax)
> >                     (const_int -1 [0xffffffff])))
> >             (clobber (reg:SI 0 ax))
> >             (clobber (reg:CC 17 flags))
> >
> > doloop_end_internal pattern (from i386.md ) doesn't match this jump
because
> > of the (clobber (reg:SI 0 ax)) which is as a result of reload (I
suppose).
>
> I don't see a problem with the clobber.  A hard register will match a
> match_scratch.
>

Yes I agree.

> I believe the problem is that operand 2 is a MEM, but the pattern uses
> register_operand.  There is an inconsistency in the pattern here, the
> cosntraints allow operands that the predicates don't.
>      (match_operand:SI 2 "register_operand" "=1,1,*m*r")
> The MEM matches the 'm' constraint, but not the register operand
> predicate.  This is not good.  The pattern should use
> nonimmediate_operand here instead of register_operand.
>

Ok, this fixes the problem.

> For optimization purposes, we perhaps want to add a condition that
> rejects a MEM before reload.  Maybe something like
>    "reload_in_progress || reload_completed
>     || register_operand (operands[2], SImode)"
> We want to do something like this because the MEM case results in less
> efficient code than the REG case.

This also sounds possible.

Since I am not familiar with the x86 port,
can you please commit this fix?

> --
> Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
>

Mostafa


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]