From: shodsdon@elrond.CalComp.COM (Steve V. Hodsdon)
Subject: Re: Compiler Bug
Date: 27 Jul 90 15:29:11 GMT [thread overview]
Message-ID: <2856@elrond.CalComp.COM> (raw)
In-Reply-To: 3152@rwthinf.UUCP
In article <3152@rwthinf.UUCP>, davids@bduxpe (Peter Davids) writes:
>
> We have DEC 3100 Workstation with Ultrix 3.1 and UWS 2.1 running.
> The following little (and correct!?) C-program gives different results,
> depending on the optimizer options.
> The programm look a bit like the own posted some time ago...
>
>
> ====cut here==============================
> char * malloc();
>
> main()
> {
> char * ba;
> int i=3;
> printf("%d\n", i*(-6) );
> ba = malloc (100);
> printf("%d\n", i*(-6) );
> }
>
> I will be happy about any idea or answer (other bugs would be also
> very interesting)
I am running a MIPS box with the R2600 CPU card (R2000 processor).
Here is the output: (using uMIPS 2.0)
[shodsdon@(bifur)/u/shodsdon/src]
3 %cc b.c
[shodsdon@(bifur)/u/shodsdon/src]
4 %a.out
-18
18
[shodsdon@(bifur)/u/shodsdon/src]
5 %cc -O b.c
[shodsdon@(bifur)/u/shodsdon/src]
6 %a.out
-18
-18
[shodsdon@(bifur)/u/shodsdon/src]
7 %cc -O0 b.c
[shodsdon@(bifur)/u/shodsdon/src]
8 %a.out
18
18
Kinda makes you wonder.
> _________________________________________________________________________
> Peter Davids Lehrstuhl fuer Informatik IV RWTH Aachen D-5100 Aachen
> Tel. +241-804522 Fax: +241-806295 davids@informatik.rwth-aachen.de
--
Steve Hodsdon | Stay sane inside insanity.
shodsdon@elrond.CalComp.COM | Don't dream it - Be it.
{decvax|harvard}!elrond!shodsdon |
(603) 885-8324 |
prev parent reply other threads:[~1990-07-27 15:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1990-07-26 5:41 Compiler Bug Peter Davids
1990-07-26 13:50 ` Jim Gettys
1990-07-27 15:29 ` Steve V. Hodsdon [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox