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

  1. Newsgroups: comp.sys.sun.misc
  2. Path: sparky!uunet!mcsun!sunic!ericom!etxkrjg
  3. From: etxkrjg@solsta.ericsson.se (Kristian Jorg  TX/DKL)
  4. Subject: Re: sun cc optimization failure
  5. Message-ID: <etxkrjg.716039624@solsta-c>
  6. Sender: news@ericsson.se
  7. Nntp-Posting-Host: solsta-c.ericsson.se
  8. Organization: Ericsson
  9. References: <1992Sep3.040401.16902@mr.med.ge.com> <1992Sep8.172519.29326@ims.com>
  10. Date: Wed, 9 Sep 1992 11:53:44 GMT
  11. Lines: 33
  12.  
  13. davek@kestrel.ims.com (Dave Koon) writes:
  14.  
  15. >In article 16902@mr.med.ge.com, carl@aslmr-serv.med.ge.com (Carl Crawford) writes:
  16. >>
  17. >>consider the following program:
  18. >>
  19. >>main() {
  20. >>    int i,j,ax;
  21. >>    ax = 0;
  22. >>    for(i=0;i<3;i++){
  23. >>        j = ax * i;
  24. >>        puts("in for loop");
  25. >>    }
  26. >>}
  27. >>when compiled with cc (sun os 4.1 on sparc 1+), the 
  28. >>code runs thru the loop three times. when comiled with 
  29. >>the -O flag it only runs once. hom come the optimization 
  30. >>screws up the loop?
  31.  
  32. >Try upgrading your machine to either 4.1.1 or 4.1.2.  I ran
  33. >your test program and did not see the problem with either 4.1.1
  34. >or 4.1.2.
  35.  
  36. No, the problem still exists in 4.1.2. I experienced exactly the same
  37. behaviour as described above.
  38.  
  39.  
  40.  
  41. --
  42. ----------------------------------------------------------------------------
  43. Kristian Jorg, Software Design Support and Methods ! I speak for myself and
  44. Ericsson Telecom AB, Karlstad, Sweden              ! Not for my company!
  45. E-mail: etxkrjg@solsta.ericsson.se           !
  46.