summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/genrecog.c25
2 files changed, 19 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index de10c4b6139..6a7151a35eb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Wed Oct 13 10:20:58 1999 Richard Henderson <rth@cygnus.com>
+
+ * genrecog.c (write_subroutine): Careful for null trees.
+ (process_tree): Don't elide empty functions.
+
Wed Oct 13 10:07:54 1999 Richard Henderson <rth@cygnus.com>
* Makefile.in (genrtl.o): Depend on ggc.h.
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);
}