From 7cb6ef9cb9d0e20a63da12d8a976db77d38c5e39 Mon Sep 17 00:00:00 2001 From: rth Date: Wed, 20 Mar 2002 00:49:13 +0000 Subject: * except.c (current_function_has_exception_handlers): New. * except.h: Declare it. * sibcall.c (optimize_sibling_and_tail_recursive_call): Use it. Combine tests that disable all sibcalls for the function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51054 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/except.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'gcc/except.c') diff --git a/gcc/except.c b/gcc/except.c index 939610ffc1f..fa92368ec8d 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -1401,6 +1401,23 @@ find_exception_handler_labels () exception_handler_labels = list; } +bool +current_function_has_exception_handlers () +{ + int i; + + for (i = cfun->eh->last_region_number; i > 0; --i) + { + struct eh_region *region = cfun->eh->region_array[i]; + + if (! region || region->region_number != i) + continue; + if (region->type != ERT_THROW) + return true; + } + + return false; +} static struct eh_region * duplicate_eh_region_1 (o, map) -- cgit v1.2.1