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]

[gccgo] Don't use __builtin_alloca


As noted earlier, __builtin_alloca does not currently work with
-fsplit-stack.  I committed this patch to the gccgo branch to remove a
case where the runtime library was using __builtin_alloca.

Ian

Index: libgo/runtime/go-reflect-call.c
===================================================================
--- libgo/runtime/go-reflect-call.c	(revision 154387)
+++ libgo/runtime/go-reflect-call.c	(working copy)
@@ -308,10 +308,11 @@ call (const struct __go_func_type *func_
   assert (func_type->__common.__code == GO_FUNC);
   go_func_to_cif (func_type, is_interface, &cif);
 
-  call_result = ((unsigned char *)
-		 __builtin_alloca (go_results_size (func_type)));
+  call_result = (unsigned char *) malloc (go_results_size (func_type));
 
   ffi_call (&cif, func_addr, call_result, params);
 
   go_set_results (func_type, call_result, results);
+
+  free (call_result);
 }

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