genrecog tweek

Richard Henderson rth@cygnus.com
Sun Oct 31 23:33:00 GMT 1999


A port that doesn't define any splits won't work at the moment
because we didn't emit the split_insns function, and we don't
do anything in the rest of the compiler to conditionally compile
that code.


r~


        * genrecog.c (write_subroutine): Careful for null trees.
        (process_tree): Don't elide empty functions.

Index: genrecog.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/genrecog.c,v
retrieving revision 1.59
diff -c -p -d -r1.59 genrecog.c
*** genrecog.c	1999/10/10 19:04:29	1.59
--- genrecog.c	1999/10/13 17:19:57
*************** peephole2%s (x0, insn, _plast_insn)\n\
*** 1859,1865 ****
       rtx *_plast_insn ATTRIBUTE_UNUSED;\n"
    };
       
!   int subfunction = head->first->subroutine_number;
    const char *s_or_e;
    char extension[32];
    int i;
--- 1859,1865 ----
       rtx *_plast_insn ATTRIBUTE_UNUSED;\n"
    };
       
!   int subfunction = head->first ? head->first->subroutine_number : 0;
    const char *s_or_e;
    char extension[32];
    int i;
*************** peephole2%s (x0, insn, _plast_insn)\n\
*** 1884,1890 ****
      printf ("  register rtx _last_insn = insn;\n");
    printf ("  %s tem ATTRIBUTE_UNUSED;\n", IS_SPLIT (type) ? "rtx" : "int");
  
!   write_tree (head, "", type, 1);
  
    if (type == PEEPHOLE2)
      printf (" ret1:\n  *_plast_insn = _last_insn;\n  return tem;\n");
--- 1884,1893 ----
      printf ("  register rtx _last_insn = insn;\n");
    printf ("  %s tem ATTRIBUTE_UNUSED;\n", IS_SPLIT (type) ? "rtx" : "int");
  
!   if (head->first)
!     write_tree (head, "", type, 1);
!   else
!     printf ("  goto ret0;\n");
  
    if (type == PEEPHOLE2)
      printf (" ret1:\n  *_plast_insn = _last_insn;\n  return tem;\n");
*************** process_tree (head, subroutine_type)
*** 2128,2144 ****
       struct decision_head *head;
       enum routine_type subroutine_type;
  {
!   if (head->first == NULL)
!     return;
! 
!   factor_tests (head);
!   simplify_tests (head);
  
!   next_subroutine_number = 0;
!   break_out_subroutines (head, 1);
!   find_afterward (head, NULL);
  
!   write_subroutines (head, subroutine_type);
    write_subroutine (head, subroutine_type);
  }
  
--- 2131,2147 ----
       struct decision_head *head;
       enum routine_type subroutine_type;
  {
!   if (head->first != NULL)
!     {
!       factor_tests (head);
!       simplify_tests (head);
  
!       next_subroutine_number = 0;
!       break_out_subroutines (head, 1);
!       find_afterward (head, NULL);
  
!       write_subroutines (head, subroutine_type);
!     }
    write_subroutine (head, subroutine_type);
  }
  



More information about the Gcc-patches mailing list