Subject: stack limit for sun3/sun3x
To: None <port-sun3@netbsd.org>
From: None <SigmFSK@aol.com>
List: port-sun3
Date: 10/16/2006 16:05:05
I'm running NetBSD 3.0 on a real sun3/80 (sun3x with 16Mb) , and also have  
NetBSD 3.0 running inside TME (emulated sun3/160 with 32Mb). 

On the real  sun3x, the following gcc-3.3.3 testsuite program 
(gcc.dg/20020425-1.c) compiles,  whereas it fails to compile inside TME with a segmentation 
violation. 

I  tracked down the cause: sun3 inside TME has a 2Mb stack limit, whereas the 
 real sun3x has an 8Mb stack limit (TME produces seg fault in NetBSD when  
attempting to push anything on the stack below SP = 0xdf80000).  Maybe the  2Mb 
stack limit is correct for a sun3 (vs. sun3x)?

Does someone know the  NetBSD 3.0 stack limits for sun3/sun3x? 
Or can someone attempt to compile  the following (under NetBSD 3.0 / 
gcc-3.3.3) on a real sun3 (vs. sun3x) and see  if the compile passes? 

If no - then TME is fine - it is correctly emulating a real sun3.
If yes - then I probably won't fix TME; I'd hate to break the MMU emulation  
code since I rarely put 2Mb on the stack, but I'll at least modify it to  
print out a warning when the 2Mb limit is reached.

thanks, 
arthur 

/* PR c/2161: parser stack overflow.   */ 
/* { dg-do compile } */ 

#define  ONE        else if (0) { } 
#define  TEN        ONE ONE ONE ONE ONE ONE ONE ONE  ONE ONE 
#define HUN        TEN TEN TEN  TEN TEN TEN TEN TEN TEN TEN 
#define  THOU        HUN HUN HUN HUN HUN HUN HUN HUN  HUN HUN 

void foo() 
{ 
if (0) { } 
/* 11,000 else  if's.  */ 
THOU THOU THOU THOU THOU THOU THOU THOU THOU THOU THOU  
}