Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Randolph Chung <randolph@tausq.org>
To: Carlos O'Donell <carlos@systemhalted.org>
Cc: John David Anglin <dave@hiauly1.hia.nrc.ca>,
	parisc-linux <parisc-linux@lists.parisc-linux.org>
Subject: [parisc-linux] Re: Looking at vfprintf.c and alloca.
Date: Tue, 18 Jul 2006 23:51:05 +0800	[thread overview]
Message-ID: <44BD0369.3090905@tausq.org> (raw)
In-Reply-To: <119aab440607172040gf1209cp52131893cea42460@mail.gmail.com>

Carlos O'Donell wrote:
> I was looking at our tst-printfsz failures in glibc, and I noticed
> some very cute code in vfprintf.c. The code uses alloca to create a
> specs structure, and then using certain know addresses decides if the
> stack grows down or up.
> 
> Does this look right? Anyone care to review if this actually works
> with a newer GCC on hppa?

I tried this with both old (gcc-3.[34]) and new gcc (gcc-4.[01]) and i 
don't think this works....

tausq@riot:~$ cat alloca.c
#include <alloca.h>
#include <stdio.h>

int main(int argc, char **argv)
{
         int *old;
         int *ptr = alloca(100 * sizeof(int));

         old = ptr;

         ptr = alloca(100 * sizeof(int));

         printf("ptr = %p\nold = %p\n&old[100] = %p\n", ptr, old, 
&old[100]);
         return 0;
}
tausq@riot:~$ gcc-4.1 -Wall -o alloca alloca.c; ./alloca
ptr = 0xc04ca590
old = 0xc04ca3d0
&old[100] = 0xc04ca560

randolph
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

  reply	other threads:[~2006-07-18 15:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-18  3:40 [parisc-linux] Looking at vfprintf.c and alloca Carlos O'Donell
2006-07-18 15:51 ` Randolph Chung [this message]
2006-07-18 16:51   ` [parisc-linux] " Michael S. Zick
2006-07-19  3:22     ` John David Anglin
2006-07-18 19:30   ` Carlos O'Donell
2006-07-18 20:11     ` Michael S. Zick
2006-07-18 20:22     ` Matthew Wilcox
2006-07-18 20:49       ` Carlos O'Donell
2006-07-19  2:48   ` John David Anglin
2006-07-19  3:04     ` Randolph Chung
2006-07-19 15:22       ` Michael S. Zick
2006-07-20  4:54         ` John David Anglin
2006-07-19  2:36 ` John David Anglin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44BD0369.3090905@tausq.org \
    --to=randolph@tausq.org \
    --cc=carlos@systemhalted.org \
    --cc=dave@hiauly1.hia.nrc.ca \
    --cc=parisc-linux@lists.parisc-linux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox