------- Comment #2 from dominiq at lps dot ens dot fr 2008-10-11 10:09 ------- In the original post I wrote:
> Between revisions 140923 and 140951 the following (invalid) code: > ... > Since the code is invalid (d = matmul...), gfortran is indeed allowed to do > whatever is happening, but I'ld like to understand the new behavior > and be sure that it cannot happen for valid codes. I suggest to remove the "Regression" keyword, but leave the pr open until the two questions are answered. Note 1: I think the error message with -fbounds-check is misleading: > With -fbounds-check I get the following error with gfortran 4.3 and 4.4: > > Fortran runtime error: Incorrect extent in return array in MATMUL intrinsic > for > dimension 1: is 1, should be 4 The problem is not with MATMUL, but with the assignment to d, so the error should be something like: Error: Different shape for array assignment at (1) on dimension 1 (1 and 4) Note2: the code is coming from pr29572. Note3: I think the same misleading error message happens for mat-2.f90 in comment #2 of pr29572, as shown by the following run-time errors: [ibook-dhum] f90/bug% a.out Fortran runtime error: dimension of array B incorrect in MATMUL intrinsic [ibook-dhum] f90/bug% gfc -fbounds-check pr29572_1.f90 [ibook-dhum] f90/bug% a.out Fortran runtime error: Incorrect extent in return array in MATMUL intrinsic for dimension 1: is 1, should be 4 The first message is right and could be improved with something like: "for dimension 1: is 4, should be 1" -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37802