This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: g77 behaviour


In a message dated 99-07-28 06:46:50 EDT, gborzi@oxygen.unime.it writes:

<<        do 10 j=1,k
         x0=x0-a(j)*x(laij(j)-l)
 10      continue >>

Sum accumulation in a non-static local is still optimized more reliably by 
gnu compilers than accumulation in an array element.  I make a practice of 
doing it this way in any case.  One of the reasons is that it may be 
necessary (on non-Intel architectures) to write the accumulation using 
DPROD() and a REAL*8 accumulation variable in order to preserve accuracy.  Of 
course, use of current standard Fortran DOT_PRODUCT() would save you the 
necessity of considering this detail.

Tim
tprince@computer.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]