This is the mail archive of the gcc-patches@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: [patch] m68k: Fix PR target/19201.


On Sun, 2005-11-27 at 16:57 -0800, Kazu Hirata wrote:

> 2005-11-28  Kazu Hirata  <kazu@codesourcery.com>
> 
>       * config/m68k/m68k.md (a peephole2): New.
>       * config/m68k/predicates.md (address_register_operand):Likewise.
Couldn't this be done with a combiner pattern?  It would seem to me
that it'd apply a lot more often than a peep2.

Basically it seems to me you've got something like

(set (tmpreg) (mem (plus (basereg0) (const_int))
(set (mem (plus (basereg1) (tmpreg)) (const_int 0)

And you'd want to turn that into

(set (tmpreg) (plus (basereg1) (mem (plus (basereg0) (const_int))))
(set (mem (tmpreg)) (const_int 0))

[ In fact, I'm a little puzzled why we don't generate the second form
  in the first place -- that seems like the natural form given the way
  the trees are presented to the tree->rtl pass. ]


Perhaps this doesn't work in combine because combine does not think
it's profitable?  Right?


Anyway, I'm OK with the patch as-is.

Jeff




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