[comp.unix.aix] Bug/Feature of Fortran under 3003?

mahesh@caradhras.cc.nd.edu (Mahesh "BigMan" Subramanya) (04/11/91)

	We just upgraded to 3003 recently, and came across this
rather neat bug/feature of the FORTRAN compiler, where when a program 
is compiled with the optimizer turned on, the compiler merrily
"skips" over entire sections of code.  It looks like DO loops are
the most likely candidates for being skipped over.  I've not been able
to track the specifics down yet (very large source).

Has anyone seen this, and do you know what it is

Oh, B.T.W., compiling without the optimizer works fine...

Frustrated and Frantic...

-- 
************************************************************************
Mahesh Subramanya                     INTERNET: mahesh@darwin.cc.nd.edu
Senior Analyst                        
Office of University Computing       
University of Notre Dame              Voice:    (219) 239-5600  x6421
Notre Dame,  IN  46556
************************************************************************

prener@watson.ibm.com (Dan Prener) (04/19/91)

In article <1991Apr11.150613.24468@news.nd.edu>, mahesh@caradhras.cc.nd.edu (Mahesh "BigMan" Subramanya) writes:
|> 
|> 	We just upgraded to 3003 recently, and came across this
|> rather neat bug/feature of the FORTRAN compiler, where when a program 
|> is compiled with the optimizer turned on, the compiler merrily
|> "skips" over entire sections of code.  It looks like DO loops are
|> the most likely candidates for being skipped over.  I've not been able
|> to track the specifics down yet (very large source).
|> 
|> Has anyone seen this, and do you know what it is
|> 
|> Oh, B.T.W., compiling without the optimizer works fine...
|> 
|> Frustrated and Frantic...
|> 

Have you reported this to IBM?
-- 
                                   Dan Prener (prener @ watson.ibm.com)

jona@iscp.Bellcore.COM (Jon Alperin) (04/22/91)

In article <1991Apr19.001820.13721@watson.ibm.com>, prener@watson.ibm.com (Dan Prener) writes:


Here's my posting, article follows for reference:

  Before telling IBM about this "bug" look at the DO loop...does
it have a finite ending? If the Do loop does not have a branch in 
it, the compiler will figure out what the end result is, and replace the
entire DO loop with the result. For example:

  If you have a DO loop which iterates and adds a number to a variable,
and the answer always comes out the same, the optimizer will figure out
that the entire loop can be replaced with a <var> = <var> + loopcount value,
saving many steps and cycle times.....could this be the case?

jon

  
|> In article <1991Apr11.150613.24468@news.nd.edu>, mahesh@caradhras.cc.nd.edu (Mahesh "BigMan" Subramanya) writes:
|> |> 
|> |> 	We just upgraded to 3003 recently, and came across this
|> |> rather neat bug/feature of the FORTRAN compiler, where when a program 
|> |> is compiled with the optimizer turned on, the compiler merrily
|> |> "skips" over entire sections of code.  It looks like DO loops are
|> |> the most likely candidates for being skipped over.  I've not been able
|> |> to track the specifics down yet (very large source).
|> |> 
|> |> Has anyone seen this, and do you know what it is
|> |> 
|> |> Oh, B.T.W., compiling without the optimizer works fine...
|> |> 
|> |> Frustrated and Frantic...
|> |> 
|> 
|> Have you reported this to IBM?
|> -- 
|>                                    Dan Prener (prener @ watson.ibm.com)

-- 
Jon Alperin
Bell Communications Research

---> Internet: jona@iscp.bellcore.com
---> Voicenet: (908) 699-8674
---> UUNET: uunet!bcr!jona

* All opinions and stupid questions are my own *