This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, fortran] PR52012 - [4.6/4.7 Regression] Wrong-code with realloc on assignment and RESHAPE w/ ORDER=


Dear Paul,

Fist, I have taken the time to look at the standard. For LBOUND,
UBOUND, SIZE, and SHAPE, it says:

> ARRAY shall be an array of any type. It shall not be an unallocated allocatable variable
> or a pointer that is not associated.

(+ constraints for "assumed-size array" and SIZE, SHAPE, and UBOUND). My reading of the "shall"
is that the burden is on the user and not on the compiler (it is not presently detected at compile
time by gfortran).

So when you write

> For an unallocated result, this is zero.

this can only be internal representation and AFAICT it is not reset on deallocation.

> the lbound should be that returned by matmul

Here I have a doubt: should it be 1 (it cannot be 0)? this could be supported by
Element (i; j) of the result has the value SUM (MATRIX A (i, :) * MATRIX B (:, j)) ...
involving section; or the lower bounds of DIM==1 for a and DIM==2 for b?

I think this should be the lbound of the lhs array after the assignment.

Quick thoughts for the time being: I have to run!

Cheers,

Dominique


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