Article View: comp.sys.dec
Article #1766Re: Compiler Bug
From: Jim Gettys
Date: Thu, 26 Jul 1990 13:50
Date: Thu, 26 Jul 1990 13:50
39 lines
966 bytes
966 bytes
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 %
Technical Details
Message-ID:
<5889@crltrx.crl.dec.com>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!decwrl!bacchus.pa.dec.com!deccrl!crltrx!jgReferences:
<3152@rwthinf.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!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 Lines: 39