From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,c94fc71280966b39 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1990-07-26 06:50:21 PST Path: gmdzi!unido!mcsun!uunet!decwrl!bacchus.pa.dec.com!deccrl!crltrx!jg From: jg@crl.dec.com (Jim Gettys) Newsgroups: comp.sys.dec Subject: Re: Compiler Bug Message-ID: <5889@crltrx.crl.dec.com> Date: 26 Jul 90 13:50:21 GMT References: <3152@rwthinf.UUCP> Sender: news@crltrx.crl.dec.com Reply-To: jg@crl.dec.com (Jim Gettys) Distribution: comp Organization: DEC Cambridge Research Lab Posted: Thu Jul 26 14:50:21 1990 Sounds like a bug under 3.1.... Results under 4.0 (which has a new compiler suite...) cat >foo.c char * malloc(); main() { char * ba; int i=3; printf("%d\n", i*(-6) ); ba = malloc (100); printf("%d\n", i*(-6) ); } zorch % cc -O foo.c -o foo zorch % foo -18 -18 zorch % cc foo.c -o foo zorch % foo -18 -18 zorch % cc -O0 foo.c -o foo zorch % foo -18 -18 zorch % cc -O3 foo.c -o foo zorch % foo -18 -18 zorch % cc -O4 foo.c -o foo zorch % foo -18 -18 zorch % cc -O1 foo.c -o foo zorch % foo -18 -18 zorch %