This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] m68k: Fix PR target/19201.
- From: Jeffrey A Law <law at redhat dot com>
- To: Kazu Hirata <kazu at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, schwab at suse dot de
- Date: Mon, 28 Nov 2005 11:56:45 -0700
- Subject: Re: [patch] m68k: Fix PR target/19201.
- References: <200511280057.jAS0v3MD026024@sparrowhawk.codesourcery.com>
- Reply-to: law at redhat dot com
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