home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.sun.misc
- Path: sparky!uunet!mcsun!sunic!ericom!etxkrjg
- From: etxkrjg@solsta.ericsson.se (Kristian Jorg TX/DKL)
- Subject: Re: sun cc optimization failure
- Message-ID: <etxkrjg.716039624@solsta-c>
- Sender: news@ericsson.se
- Nntp-Posting-Host: solsta-c.ericsson.se
- Organization: Ericsson
- References: <1992Sep3.040401.16902@mr.med.ge.com> <1992Sep8.172519.29326@ims.com>
- Date: Wed, 9 Sep 1992 11:53:44 GMT
- Lines: 33
-
- davek@kestrel.ims.com (Dave Koon) writes:
-
- >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?
-
- >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.
-
- No, the problem still exists in 4.1.2. I experienced exactly the same
- behaviour as described above.
-
-
-
- --
- ----------------------------------------------------------------------------
- Kristian Jorg, Software Design Support and Methods ! I speak for myself and
- Ericsson Telecom AB, Karlstad, Sweden ! Not for my company!
- E-mail: etxkrjg@solsta.ericsson.se !
-