From: "Marc E. Fiuczynski" <mef@CS.Princeton.EDU>
To: <gcc-help@gcc.gnu.org>
Subject: will gcc support better stack space reuse?
Date: Tue, 12 Jul 2005 03:51:00 -0000 [thread overview]
Message-ID: <NIBBJLJFDHPDIBEEKKLPOEIEFFAA.mef@cs.princeton.edu> (raw)
Hi,
Was wondering whether a new version of GCC for x86 (linux) can now
reallocate unused stack space from locals defined in different scopes.
E.g., functions suck1 and suck2 suffer from increased stack pressure because
gcc (in my case 3.3.3 on linux/x86) cannot smartly reuse the stack space.
Anyone out there with insight on why this is the case and when gcc might
handle stack packing (if not already).
int garray[64];
static inline numberone(int a, int b){
int array[64];
array[1]=a*b;
garray[0]=array[1];
}
static inline numbertwo(int a, int b){
int array[64];
array[1]=a*b;
garray[1]=array[1];
}
void suck1(int a, int b){
numberone(a,b);
numbertwo(a,b);
}
void suck2(int a, int b){
{
int array[64];
array[1]=a*b;
garray[0]=array[1];
}
{
int array[64];
array[1]=a*b;
garray[1]=array[1];
}
}
Marc
reply other threads:[~2005-07-12 3:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=NIBBJLJFDHPDIBEEKKLPOEIEFFAA.mef@cs.princeton.edu \
--to=mef@cs.princeton.edu \
--cc=gcc-help@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).