This is the mail archive of the 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: Further observations regarding alloca on i586-pc-linux-gnu

I just tried the test on MS Visual C++ 5.0 with SP3 installed.
It crashes the compiler (fatal error C1001: INTERNAL COMPILER ERROR).
So, egcs just silently generates bad code while VC++ crashes. Both
not exactly the right thing, but I actually prefer the VC++ crash.

I really think the test is valid. There are no documented constraints
on the usage of alloca. An option "-fno-inline-alloca" and the generic
alloca emulation included in glibc would provide a useable work around.

Richard Henderson wrote:
> 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~

GMD-IPSI, Dolivostr. 15, Zimmer 120, D-64293 Darmstadt
+49-6151-869-786 (Phone), -818 (FAX)

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