This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/18495] Intrinisc function SPREAD is broken
- From: "paulthomas2 at wanadoo dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Nov 2004 14:58:35 -0000
- Subject: [Bug libfortran/18495] Intrinisc function SPREAD is broken
- References: <20041115053618.18495.paulthomas2@wanadoo.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From paulthomas2 at wanadoo dot fr 2004-11-15 14:58 -------
Looking at the source of SPREAD, I note that it does not assert the rank of the
output matrix. Thus, in the fragment from the LLNL test it should be possible
to output the calls to SPREAD to temporary arrays, multiply these and add them
to the result. Thus:
DO K = 1, 25
PRTTEMP = SPREAD(VY(:25,K),DIM = 2,NCOPIES = N)
PRTTEMP = PRTTEMP * SPREAD(CX(K,:N),DIM = 1,NCOPIES = 25)
PX(:,:N) = PX(:,:N) + PRTTEMP
!! PX(:,:N) = PX(:,:N) + SPREAD(VY(:25,K),DIM = 2,NCOPIES = N)* &
!! & SPREAD(CX(K,:N),DIM = 1,NCOPIES = 25)
END DO
works but the commented out part does not.
Is the caller or the callee responsible for asserting the rank of the output?
If the latter, the fix is trivial. If the former, the problem is not with
SPREAD but with the compiler front-end not assigning intermediate temporaries
the correct rank.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18495