diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-10-13 17:22:40 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-10-13 17:22:40 +0000 |
commit | a5deb6f6f673dbab2380742300fd418e57741303 (patch) | |
tree | a20d99d6120df50b68cea46249962e38725a9992 /gcc/genrecog.c | |
parent | 68028e67556a0d7d56837cff157d5636b9a90863 (diff) | |
download | gcc-a5deb6f6f673dbab2380742300fd418e57741303.tar.gz |
* genrecog.c (write_subroutine): Careful for null trees.
(process_tree): Don't elide empty functions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29948 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genrecog.c')
-rw-r--r-- | gcc/genrecog.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/gcc/genrecog.c b/gcc/genrecog.c index bc49d45a770..0114bc17533 100644 --- a/gcc/genrecog.c +++ b/gcc/genrecog.c @@ -1859,7 +1859,7 @@ peephole2%s (x0, insn, _plast_insn)\n\ rtx *_plast_insn ATTRIBUTE_UNUSED;\n" }; - int subfunction = head->first->subroutine_number; + int subfunction = head->first ? head->first->subroutine_number : 0; const char *s_or_e; char extension[32]; int i; @@ -1884,7 +1884,10 @@ peephole2%s (x0, insn, _plast_insn)\n\ printf (" register rtx _last_insn = insn;\n"); printf (" %s tem ATTRIBUTE_UNUSED;\n", IS_SPLIT (type) ? "rtx" : "int"); - write_tree (head, "", type, 1); + 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"); @@ -2128,17 +2131,17 @@ process_tree (head, subroutine_type) struct decision_head *head; enum routine_type subroutine_type; { - if (head->first == NULL) - return; - - factor_tests (head); - simplify_tests (head); + if (head->first != NULL) + { + factor_tests (head); + simplify_tests (head); - next_subroutine_number = 0; - break_out_subroutines (head, 1); - find_afterward (head, NULL); + next_subroutine_number = 0; + break_out_subroutines (head, 1); + find_afterward (head, NULL); - write_subroutines (head, subroutine_type); + write_subroutines (head, subroutine_type); + } write_subroutine (head, subroutine_type); } |