Newsgroups: comp.windows.x
Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!csri.toronto.edu!moraes
From: moraes@csri.toronto.edu (Mark Moraes)
Subject: Re: Problem with R3 make Sun4, SunOS 3.2
Message-ID: <8902080419.AA09920@dupont.csri.toronto.edu>
Organization: University of Toronto, CSRI
References: <8902062135.AA04548@mbunix.mitre.org> <169@lupine.UUCP>
Date: Tue, 7 Feb 89 23:19:59 EST

In article <169@lupine.UUCP> djm@lupine.UUCP (Dave Mackie) writes:
>	The -DINCLUDE_ALLOCA_H causes /usr/include/alloca.h to be included
>	when compiling. This file (for a reason someone from SUN would have
>	to explain) changes alloca(x) to a call to __builtin_alloca(x)
>	when you're compiling on a SPARC architecture.

The sparc compiler needs to know about the alloca, presumably because
of optimization and register windows in the sparc.

Gcc can also use __builtin_alloca, and it generates a few inline
instructions to change the frame pointer - the Purdue2.0 fixes include
a patch to os.h to do this; the performance improvement from this
alone is significant, because a lot of the drawing functions in the
server call ALLOCATE_LOCAL and DEALLOCATE_LOCAL a lot.

The sparc compiler doesn't do this, which is a pity. It actually
generates the function call.

