                            CMAX Version 2.0
                     Bug Update Report for May 1994
                     For Connection Machine Systems

FIXED BUGS

The following bugs have been fixed in the current release,
Version 2.0. For a description of any bug listed here, contact
your Applications Engineer or the Customer Support group
at Thinking Machines Corporation.

TMCaa01837	MAXVAL of ABS doesn't convert
TMCaa03295	Promoted scalar temporaries not reused
TMCaa03377	Reductions into array elements not recognized
TMCaa03381	COUNT of nontrivial expressions not recognized
TMCaa03920	Incorrect ELSEWHERE generated
TMCaa03936	Promoted scalars indexed incorrectly in I/O statements
TMCaa04041	Segfault with NOVECTORIZE in IF
TMCaa04047	Bad things recognized as reductions of intrinsics
TMCaa04082	Non-integer loop bound expression convert to illegal CMF
TMCaa04089	Segmentation fault during loop pushing
TMCaa04090	Bad unpromoted scalars with loop pushing
TMCaa04100	Promoted scalars sometimes given inefficient layouts
TMCaa04155	Variable clobbered after use as loop index
TMCaa04175	Block structure mangled
TMCaa04178	-LineWidth doesn't help on long strings
TMCaa04179	Names for CSHIFT functions are wrong.
TMCaa04180	Loop around call to I/O causes segfault
TMCaa04192	ENDWHERE inserted in wrong place
TMCaa04193	translated  CMF_SCAN_* incorrect on mixed data types
TMCaa04194	Translated CMF_SCANS_* last value is not saved
TMCaa04198	Variable loop bound computation gets fissioned badly
TMCaa04286	Original variable referenced instead of promoted version
TMCaa04321	Variable substitution and computed loop bounds broken
TMCaa04334	Bus error with lots of ENTRY statements
TMCaa04416	Incorrect code for stride -1 loop
TMCaa04470	LAYOUT inserted before declaration because of DATA
TMCaa04538	Logical IF mistranslated
TMCaa04546	Cloned functions declared illegally
TMCaa04553	Invariant MAXLOC index dropped
TMCaa04582	Bad FORALL in array promotion broadcast
TMCaa04583	Unterminated block IF created
TMCaa04585	IF/ELSEIF/ELSE (with mixed invariance) causes segfault
TMCaa04906	Intelligence intrinsics not recognized

OUTSTANDING BUGS

The following bugs are outstanding in the current release.

TMCaa01824	Reductions nested in nonvectorizable loops not recognized
TMCaa02988	Align propagation
TMCaa03791	F90 keyword renaming does not work in include files
TMCaa03799	FORALL generated instead of DO loop for serial function test 
TMCaa03873	Parameter values sometimes substituted in output code
TMCaa03895	WHERE emitted too aggressively
TMCaa03929	MAXVAL of promoted scalar does not convert
TMCaa03975	using CMF$ALIGN cuases error without CMF$LAYOUT
TMCaa04147	Arrays sometimes incorrectly recognized as "automatic"
TMCaa04177	-ZeroArray creates bad code on program fragments


Each of these bugs is detailed below.

*********************************************************
ID: TMCaa01824

Title:	Reductions nested in nonvectorizable loops not recognized


Description:
The MAXLOC idiom (and other idioms) are not always recognized when
used inside other, nonvectorizable loops.
  

Workaround:
Use CMF$NOVECTORIZE around outer loops.
  

Status:	Outstanding.

*********************************************************
ID: TMCaa02988

Title:	Align propagation


Description:
CMF$ALIGN directives, and the relationships they establish between
layouts of arrays, are not always propagated through function calls.

Workaround:
Use CMF$LAYOUT.

Status:	Outstanding.

*********************************************************
ID: TMCaa03791

Title:	F90 keyword renaming does not work in include files


Description:
 F90 keyword renaming does not work in include files.  For example, if a
declaration of a variable "SUM" appears in an include file, uses of it will
be renamed to be F90_KEYWORD_RENAME_SUM, but the declaration will not.  
  
The new variable F90_KEYWORD_RENAME_SUM will have whatever type it gets due
to the user's IMPLICIT typing scheme.  If the user used IMPLICIT NONE, the
error will be caught by CMAX itself.
  
CMAX prints a warning whenever it renames anything, whether it is in an
include file or not.
  
  

Workaround:
Rename the variable manually to not conflict with F90 keywords, or
include the include file inline.
  

Status:	Outstanding.

*********************************************************
ID: TMCaa03799

Title:	FORALL generated instead of DO loop for serial function test 


Description:
If the test of an IF statement is a call to a function, CMAX may
translate the IF (inside a loop) into a FORALL.  This works for most
cases, but leads to a CMF warning that the FORALL will be serialized.
But if the test involves character arrays, then the code generated is not
legal CM Fortran, because character arrays cannot have CM homes.

Workaround:
Use CMAX$NOVECTORIZE

Status:	Outstanding.

*********************************************************
ID: TMCaa03873

Title:	Parameter values sometimes substituted in output code


Description:
In some circumstances, values of named parameters are substituted in
the output code.  

Workaround:

Status:	Outstanding.

*********************************************************
ID: TMCaa03895

Title:	WHERE emitted too aggressively


Description:
CMAX will sometimes too aggressively convert an IF inside a DO loop to
a WHERE statement.  If a variable used in the IF condition is assigned
to in a branch of an IF/ELSEIF/ELSE chain, then the resulting WHERE
construct will be incorrect.  For example:

    do i = 1,100
       if (a(i).eq.23) then
          b(i) = -a(i)
       else if (a(i).ne.b(i)) then
          b(i) = a(i)
       else if (a(i).lt.b(i)) then
          b(i) = a(i) * 2.0
       else
          b(i) = 0.0
       endif
    end do

Translates to:

    WHERE (a .EQ. 23)
      b = -a
    ENDWHERE
    WHERE (.NOT.a .EQ. 23 .AND. a .NE. b)
      b = a
    ENDWHERE
    WHERE (.NOT.(a .EQ. 23 .OR. a .NE. b) .AND. a .LT. b)
      b = a * 2.0
    ENDWHERE
    WHERE (.NOT.(a .EQ. 23 .OR. a .NE. b .OR. a .LT. b))
      b = 0.0
    ENDWHERE

Because B is both assigned to and used in the conditions, the later
tests are not equivalent to the serial code.

Workaround:
Use CMAX$NOVECTORIZE, or introduce a temporary variable to store the
original value of any array both assigned to and used in a condition.


Status:	Outstanding.

*********************************************************
ID: TMCaa03929

Title:	MAXVAL of promoted scalar does not convert


Description:
MAXVAL of promoted scalar does not convert. Converted code will have to
be editted. 

Workaround:

Status:	Outstanding.

*********************************************************
ID: TMCaa03975

Title:	using CMF$ALIGN cuases error without CMF$LAYOUT


Description:
Using CMF$ALIGN causes CMAX to generate a "defined in more than one
directive" error message. If you want to align two arrays than in the
subroutine that has the CMF$ALIGN directive make sure you include a
CMF$LAYOUT directive for the array you are aligning.

Workaround:
The workaround is to add a layout directive for the array you are aligning
to (u) in the same subr that has the align directive.  This somehow prevents
cmax from propagating the redundant layout directive for the other array
(bdmask).
  
  

Status:	Outstanding.

*********************************************************
ID: TMCaa04147

Title:	Arrays sometimes incorrectly recognized as "automatic"


Description:
An array dimensionsioned with an expression containing a parameter
with a floating point value will be incorrectly recognized as an
"automatic" array.

Workaround:
Replace the floating point parameter with an integer parameter.

Status:	Outstanding.

*********************************************************
ID: TMCaa04177

Title:	-ZeroArray creates bad code on program fragments


Description:
-ZeroArray creates erroroneous code is used on only program fragment. The
workaround is to gice CMAX the whole program or a dummy stub.

Workaround:
The workaround is to give CMAX either the whole program or a dummy stub
that calls the program fragment.
  
  

Status:	Outstanding.

