This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[addrmodes] Remove genrecog wart
- From: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 23 Aug 2006 14:34:30 +0200
- Subject: [addrmodes] Remove genrecog wart
Sometimes genrecog creates a node just to discard it soon afterwards.
This happens for peephole2's made of one instruction (helpful to rewrite
as parallels that clobber a new scratch register, for example). This
finishes the genrecog work for now.
Committed to branch (separately because it changes the output for ARM).
Paolo
2006-08-23 Paolo Bonzini <bonzini@gnu.org>
* genrecog.c (make_peephole2_sequence): Never create nodes to discard them.
Index: genrecog.c
===================================================================
--- genrecog.c (revision 116346)
+++ genrecog.c (working copy)
@@ -765,22 +765,19 @@ make_peephole2_sequence (rtx insn)
c_test_pos[1] = '\0';
validate_pattern (x, insn, NULL_RTX, 0);
- last = new_decision ("", &head);
/* Check we have sufficient insns. This avoids complications
because we then know peep2_next_insn never fails. */
if (num_insns > 1)
{
+ last = new_decision ("", &head);
place = &last->tests;
test = new_decision_test (DT_num_insns, &place);
test->u.num_insns = num_insns;
next = &last->success;
}
else
- {
- head.first = head.last = NULL;
- next = &head;
- }
+ next = &head;
for (i = 0; i < XVECLEN (x, 0); i++, subpos[0]++)
{