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]

[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]++)
     {

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