This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gccgo] Don't use __builtin_alloca
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 23 Dec 2009 15:34:29 -0800
- Subject: [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);
}