home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.sun.misc
- Path: sparky!uunet!gatech!rpi!scott.skidmore.edu!psinntp!psinntp!ims.com!kestrel!davek
- From: davek@kestrel.ims.com (Dave Koon)
- Subject: Re: sun cc optimization failure
- Message-ID: <1992Sep8.172519.29326@ims.com>
- Sender: usenet@ims.com (USENET News Poster)
- Reply-To: davek@kestrel.ims.com
- Organization: Integrated Measurement Systems
- References: <1992Sep3.040401.16902@mr.med.ge.com>
- Date: Tue, 8 Sep 1992 17:25:19 GMT
- Lines: 31
-
- In article 16902@mr.med.ge.com, carl@aslmr-serv.med.ge.com (Carl Crawford) writes:
- >
- >consider the following program:
- >
- >main() {
- > int i,j,ax;
- > ax = 0;
- > for(i=0;i<3;i++){
- > j = ax * i;
- > puts("in for loop");
- > }
- >}
- >when compiled with cc (sun os 4.1 on sparc 1+), the
- >code runs thru the loop three times. when comiled with
- >the -O flag it only runs once. hom come the optimization
- >screws up the loop?
- >--
- >Carl R. Crawford Voice: 414-521-6572
- >GE Medical Systems Fax: 414-521-6575
- >P.O. Box 414, W-875 Internet: crawfordc@med.ge.com
- >Milwaukee, WI 53201
-
-
- Try upgrading your machine to either 4.1.1 or 4.1.2. I ran
- your test program and did not see the problem with either 4.1.1
- or 4.1.2.
-
- This is probably easier than coding around ;-).
-
- Dave Koon
-
-