This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
noreturn sibcall fix II
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 10 Oct 2002 16:48:50 +0200
- Subject: noreturn sibcall fix II
Hi,
this is the second part of the fix. calls.c is little bit inconsistent
on deciding wheteher function is noreturn or not - sometimes it uses
declaration, sometimes type. In C I guess this match, while Java
apparently generates call with noreturn declaration but normal type.
Perhaps it would make sense to sanify Java in this respect too, but it
is not needed, because AFAIK no other code uses this flag.
Unforutnately it is dificult to grep for it as we overload TREE_VOLATILE
for this.
Bootstrapped/regtested BIB. OK?
Thu Oct 10 16:45:39 CEST 2002 Jan Hubicka <jh@suse.cz>
* calls.c (expand_call): Simplify noreturn call.
Index: calls.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/calls.c,v
retrieving revision 1.231.4.8
diff -c -3 -p -r1.231.4.8 calls.c
*** calls.c 7 Oct 2002 04:35:02 -0000 1.231.4.8
--- calls.c 10 Oct 2002 14:44:33 -0000
*************** expand_call (exp, target, ignore)
*** 2442,2450 ****
/* Check whether the target is able to optimize the call
into a sibcall. */
|| !(*targetm.function_ok_for_sibcall) (fndecl, exp)
! || (flags & (ECF_RETURNS_TWICE | ECF_LONGJMP))
! /* Functions that do not return may not be sibcall optimized. */
! || TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (exp, 0))))
/* If this function requires more stack slots than the current
function, we cannot change it into a sibling call. */
|| args_size.constant > current_function_args_size
--- 2442,2448 ----
/* Check whether the target is able to optimize the call
into a sibcall. */
|| !(*targetm.function_ok_for_sibcall) (fndecl, exp)
! || (flags & (ECF_RETURNS_TWICE | ECF_LONGJMP | ECF_NORETURN))
/* If this function requires more stack slots than the current
function, we cannot change it into a sibling call. */
|| args_size.constant > current_function_args_size