This is the mail archive of the gcc@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]

Re: alloca "bug" on x86?


On Tue, 21 Sep 1999 06:51:06 -0600, you wrote:

>
>  In message <199909211234.NAA22457@tiuk.ti.com>you write:
>  > Nick Ing-Simmons <nik@tiuk.ti.com> writes:
>  > >This is a multi-part message in MIME format...
>  > >
>  > >The attached distilled fragment has been working fine on SPARC for years.
>  > >(I include .c file for brevity, the preprocessed .i file for reproduceabil
>  > ity
>  > >and the .s file for easy examination.)
>  > 
>  > Why did it attach like that?
>  > anyway here are .c and .s files in a more-readable form
>That's a known problem.  You should not use alloca within a function call
>sequence like that.
>
>This may be a bug in the compiler, or it may not have defined behavior
>according to the standard.  I don't know.  But I do know it doesn't work :-)

alloca ()? In the standard? What standard? :-) Anyway here's a snippet
from Solaris' man page:

    The alloca() function is machine-, compiler-,  and  most  of
    all, system-dependent. Its use is strongly discouraged.

Of course, it'd be nice if the compiler gathered all allocas in an
expression and evaluated them before the rest of the expression, but
then again...

>jeff

Dima


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