From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5577 invoked by alias); 7 Aug 2009 22:36:40 -0000 Received: (qmail 5545 invoked by alias); 7 Aug 2009 22:36:28 -0000 Date: Fri, 07 Aug 2009 22:36:00 -0000 Message-ID: <20090807223628.5544.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/41001] alloca broken for -fno-builtin In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "joseph at codesourcery dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-08/txt/msg00777.txt.bz2 ------- Comment #4 from joseph at codesourcery dot com 2009-08-07 22:36 ------- Subject: Re: alloca broken for -fno-builtin On Fri, 7 Aug 2009, ktietz at gcc dot gnu dot org wrote: > Well, if so. It makes no sense that -fno-builtins tries to call a function > which isn't present. But for other compilers, alloca can be invoked as > function, too. The compiler builtin part in all cases is, to be aware that > stack frame changes (hot-region, call save-area, and co are adjusted after > calling it). -fno-builtin means more or less exactly that the compiler *should not* assume anything special about a function from its name (unless the name starts __builtin or some similar reserved-namespace cases such as __sync) - that is, you declare alloca and because of -fno-builtin the compiler assumes this is your own function with no special semantics whatever. By -fno-builtin you are declaring that alloca, and all other normally built-in functions, are normal functions with no special semantics the compiler needs to know about. So of course it generates a call like it would to any other random function you might have defined in another translation unit. If you want to use alloca with its traditional memory allocation semantics with -fno-builtin, you'll need to use a malloc-based emulation such as that in libiberty, not something that uses the stack. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41001