This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Do not RTL inline functions calling `longjmp'


I propose the following patch. The patch fixes 3 compiler crashes in
GNU Pascal testsuite on Sparc (fjf512.pas, math.pas, nonlocgoto.pas).
It also fixes incorrect assembly for `nlgpp2.pas' on ppc-darwin (see
PR/13093). 

As I understand GCC cannot inline functions containing `longjmp' (builtin
`longjmp' is similar to nonlocal goto which is already forbiden by 
`function_cannot_inline_p', also C tree inliner will not inline such
function). AFIKS C testcase is impossible, since C tree inliner will
mark functions containing `longjmp' as uninlinable and RTL inliner
will not try to inline them.

I have bootstraped gcc-3.4-20031015 (the latest snapshot where I am able
to build Ada) on i386-linux (Debian Woody on Athlon XP). I ran the
testsuite and I saw no new failures.

ChangeLog:
        * integrate.c (function_cannot_inline_p): forbid inlining functions
          calling `longjmp'.

diff -rbu gcc-3.3.2.orig/gcc/integrate.c gcc-3.3.2/gcc/integrate.c
--- gcc-3.3.2.orig/gcc/integrate.c	Tue Jul 15 03:05:43 2003
+++ gcc-3.3.2/gcc/integrate.c	Mon Nov 10 03:12:54 2003
@@ -180,6 +180,9 @@
   if (current_function_calls_alloca)
     return N_("function using alloca cannot be inline");
 
+  if (current_function_calls_longjmp)
+    return N_("function using longjmp cannot be inline");
+	  
   if (current_function_calls_setjmp)
     return N_("function using setjmp cannot be inline");
 

-- 
                              Waldek Hebisch
hebisch@math.uni.wroc.pl 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]