This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/43597] Move and compare with 0 can be combined
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Mar 2010 22:49:54 -0000
- Subject: [Bug target/43597] Move and compare with 0 can be combined
- References: <bug-43597-17659@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from steven at gcc dot gnu dot org 2010-03-31 22:49 -------
It's not very hard to add a define_peephole2 pattern for this case also,
although it's a bit of a hack.
I'm not even sure if it would handle the case cmp+mov and mov+cmp case -- does
peephole2 care about the order of the insns? If so, then you'd really need even
2 new define_peephole2's. You'd almost think we need a post-reload combine,
yuck... :-)
OTOH there are already a few define_peephole2's in arm.md to catch this kind of
simple optimization that combine fails to handle, so it's apparently
acceptable. And there is no easy way around this otherwise. I can't think of a
way to teach combine when it maybe could be should be to apply combine
transformations to likely-spilled regs.
--
steven at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bernds at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43597