public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] ia64 gcc implementation of alloca
@ 2000-06-06 22:34 roneng
  2000-06-07  1:29 ` Jim Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: roneng @ 2000-06-06 22:34 UTC (permalink / raw)
  To: linux-ia64


Hi,
Has anyone had any problem using alloca, or knows where in the gcc code it
is implemented?
when I run my program get the following error:

Program received signal SIGSEGV, Segmentation fault.
loose (code\x14, fd=6, name=0x9ffffffffff05ca0 "libnss_files.so.2",
    realname=0x60000000000115b0 "/lib/libnss_files.so.2", l=0x0,
    msg=0x200000000002f880 "cannot read file data") at dl-load.c:642
642       a[0] = fd;
(gdb)

the code around line 642 is the following
__attribute__ ((noreturn))
lose (int code, int fd, const char *name, char *realname, struct link_map
*l,
      const char *msg)
{
  /* The use of `alloca' here looks ridiculous but it helps.  The goal
     is to avoid the function from being inlined.  There is no official
     way to do this so we use this trick.  gcc never inlines functions
     which use `alloca'.  */
int *a = alloca (sizeof (int));
a[0] = fd;

simple testcases of alloca seem to work, so this is probably an
intermittent problem.

Thank you,
Ronen Grosman
- e-mail roneng@ca.ibm.com





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-06-07  1:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-06-06 22:34 [Linux-ia64] ia64 gcc implementation of alloca roneng
2000-06-07  1:29 ` Jim Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox