[net.sources] Problem with MANX/Aztec C

XBR2D995%DDATHD21.BITNET@WISCVM.WISC.EDU (05/21/86)

Hello,

we have a serious problem with Aztec-C 3.20a and float arrays. The
program at the end of my message compiles an links correctly, but gives
a guru meditation (00000003.000097B0) wenn started. The program is
compiled and linked with the following command:

  CC T3
  LN T3.O -lm -lc

The same program gives an assembler error when compiled with

  CC T3 +l

We think the problem is related to the expression:

  z[k][m] = z[k][m] - z[k][i] * z[i][k]

in the program. Reducing the "complexity" of the statement resolves
both problems.

Any people from Manx listening? Anybody got the same problem?

Regards
Martin

My address: Martin Knoblauch
            Technische Hochschule Darmstadt
            Dept. for Physical Chemistry (PC 1)
            Petersenstrasse 20
            D-6100 Darmstadt (West Germany)
BITNET:     <XBR2D995@DDATHD21.BITNET>
----------------------------T3.C-------------------------------------
#include <exec/types.h>
#include <libraries/mathffp.h>
#undef NULL
#include <stdio.h>

main()
#define BOR 5
{
  int i,k,m;
  float  a1,a2,a3;
  static float z[BOR][BOR];

  printf(" programmstart now\n");

  for(i=0;i<BOR;i=i+1)
     {
      z[i][i] = 3.33333;
     }

  for(i=0;i<BOR;i=i+1)
     {
      for(k=0;k<BOR;k=k+1)
         {
          for(m=0;m<BOR;m=m+1)
             {
               printf(" i k m = %d %d %d \n",i,k,m);
               /* The following statement causes the program
                  to crash (GURU: 00000007:000097b0) when
                  compiled with CC T3.
                  Trying to compile the program with
                                CC T3 -L
                  gives an assembler error */

               z[k][m] = z[k][m] - z[k][i] * z[i][m];

              /* The following statements work ok, and there
                 are no assembler errors. This is no real solotion,
                 because it slows down the program and makes the
                 program less understandable.

               a1 = z[k][m];
               a2 = z[k][i];
               a3 = z[i][m];
               z[k][m] = a1 - a2 * a3;

             */
             }
         }
     }
}
-----------------------------------------------------------------------