Further observations regarding alloca on i586-pc-linux-gnu

Richard Henderson rth@cygnus.com
Sun Aug 23 04:36:00 GMT 1998


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~



More information about the Gcc mailing list