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]
Other format: [Raw text]

Re: [PATCH,testsuite] fix STACK_SIZE issue in pr23135.c

On Mon, 2007-07-09 at 13:03 -0700, Nathan Froyd wrote:
> The attached patch fixes an issue with pr23135.c and STACK_SIZE.  We
> declare:
> typedef struct { char c[STACK_SIZE/2]; } big_t;
> thinking that we will only need one copy of big_t inside our main
> function.  Except that we pass a big_t by value, so we need to copy it,
> which means that we have two STACK_SIZE/2 objects on the stack, plus any
> local variables, saved registers, etc. etc.  Therefore, our stack size
> requirement winds up exceeding STACK_SIZE.  So we need to be a bit more
> conservative in how big a big_t is, which is what this patch does.
> It's possible that there may still be platforms on which this fails, but
> this patch is at least an improvement on what we had before.
> Tested on {i586,ppc,sparc}-wrs-vxworks with STACK_SIZE defined to be
> 192k.  The testcase failed on these platforms previously and passes with
> the patch.  OK to commit?

The test was constructed to demonstrate a reload problem on sh-elf, and
with the changes it's quite possible that it would no longer demonstrate
that problem.

Instead of changing how STACK_SIZE is used, you could use dg-options
to define STACK_SIZE for vxworks (and possibly other) targets for which
the default value isn't reasonable.


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