Subject: cc/sparc miscompile / lack of warnings?
To: None <port-sparc@NetBSD.ORG>
From: Al Slater <aslater@larissa.bri.hp.com>
List: port-sparc
Date: 04/21/1998 08:54:59
Hi,

the following:

int main(argc, argv)
int argc;
char *argv[];
{
  unsigned char c[524288];
  if (argc != 3)
    exit(1);
  return(0);
}

keels over with a segmentation fault [1]. The same on SunOS
4.1.4 doesn't. Having looked at the output asm, I presume this
is because 524288 is just outside of what can be represented
in 22 bits worth ? (262144 works fine)

I suppose the correct option is Not To Do That :)

cheers,
al.

[1] - stock 1.3/sparc.