This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Further observations regarding alloca on i586-pc-linux-gnu
- To: Carlo Wood <carlo at runaway dot xs4all dot nl>, egcs-bugs at cygnus dot com
- Subject: Re: Further observations regarding alloca on i586-pc-linux-gnu
- From: Richard Henderson <rth at cygnus dot com>
- Date: Sun, 23 Aug 1998 04:36:00 -0700
- Cc: pommnitz at darmstadt dot gmd dot de, "egcs at cygnus dot com" <egcs at cygnus dot com>
- References: <oryasifca8.fsf@iguacu.dcc.unicamp.br> <199808221724.TAA14230@jolan.ppro>
- Reply-To: Richard Henderson <rth at cygnus dot com>
On Sat, Aug 22, 1998 at 07:24:11PM +0200, Carlo Wood wrote:
> ??? pushl $10 # put '\n' on the stack
> addl $-20,%esp # allocate 20 bytes on the stack
[...]
> In other words: This is a bug.
This is well known. What is not clear to me though, is whether
it is a bug in the compiler or in the test.
The test is effectively relying on the order in which arguments
are evaluated, which is wrong. Note that the exact same effect
would happen if alloca was not a builtin. Note that if you mind
sequence points like you ought, you get correct results.
r~