home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / sun / misc / 4139 < prev    next >
Encoding:
Text File  |  1992-09-08  |  1.2 KB  |  44 lines

  1. Newsgroups: comp.sys.sun.misc
  2. Path: sparky!uunet!gatech!rpi!scott.skidmore.edu!psinntp!psinntp!ims.com!kestrel!davek
  3. From: davek@kestrel.ims.com (Dave Koon)
  4. Subject: Re: sun cc optimization failure
  5. Message-ID: <1992Sep8.172519.29326@ims.com>
  6. Sender: usenet@ims.com (USENET News Poster)
  7. Reply-To: davek@kestrel.ims.com
  8. Organization: Integrated Measurement Systems
  9. References: <1992Sep3.040401.16902@mr.med.ge.com>
  10. Date: Tue, 8 Sep 1992 17:25:19 GMT
  11. Lines: 31
  12.  
  13. In article 16902@mr.med.ge.com, carl@aslmr-serv.med.ge.com (Carl Crawford) writes:
  14. >
  15. >consider the following program:
  16. >
  17. >main() {
  18. >    int i,j,ax;
  19. >    ax = 0;
  20. >    for(i=0;i<3;i++){
  21. >        j = ax * i;
  22. >        puts("in for loop");
  23. >    }
  24. >}
  25. >when compiled with cc (sun os 4.1 on sparc 1+), the 
  26. >code runs thru the loop three times. when comiled with 
  27. >the -O flag it only runs once. hom come the optimization 
  28. >screws up the loop?
  29. >--
  30. >Carl R. Crawford       Voice: 414-521-6572
  31. >GE Medical Systems       Fax: 414-521-6575
  32. >P.O. Box 414, W-875       Internet: crawfordc@med.ge.com
  33. >Milwaukee, WI 53201       
  34.  
  35.  
  36. Try upgrading your machine to either 4.1.1 or 4.1.2.  I ran
  37. your test program and did not see the problem with either 4.1.1
  38. or 4.1.2.
  39.  
  40. This is probably easier than coding around ;-).
  41.  
  42. Dave Koon
  43.  
  44.