erroneous "clobbering" warning when using setjmp() (reproducible, w/ small source)
Richard Henderson
rth@cygnus.com
Tue Oct 26 12:35:00 GMT 1999
On Wed, Oct 20, 1999 at 01:53:41PM +0200, Johan Lindh wrote:
> Personally, I simply think that no-one thought of this situation
> occuring, and so no provisions have been made for it.
I think you're right. It doesn't make sense to inline a function
using setjmp, produceing interesting changes of success/failure of
a program depending on whether the function actually got inlined.
r~
* integrate.c (function_cannot_inline_p): Don't allow inlining
if setjmp is used.
Index: integrate.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/integrate.c,v
retrieving revision 1.73
diff -c -p -d -r1.73 integrate.c
*** integrate.c 1999/10/26 08:34:45 1.73
--- integrate.c 1999/10/26 19:32:41
*************** function_cannot_inline_p (fndecl)
*** 145,150 ****
--- 145,153 ----
if (current_function_calls_alloca)
return N_("function using alloca cannot be inline");
+ if (current_function_calls_setjmp)
+ return N_("function using setjmp cannot be inline");
+
if (current_function_contains_functions)
return N_("function with nested functions cannot be inline");
More information about the Gcc-patches
mailing list