On the attached sample code the compiler fails to issue a shape conformance error message, which is indeed printed by other compilers (e.g. Intel 8.1) [sfilippo@localhost TEMP]$ gfortran -v Using built-in specs. Configured with: ../gcc-4.0-20050130/configure --prefix=/usr/local/gfortran Thread model: posix gcc version 4.0.0 20050130 (experimental) [sfilippo@localhost TEMP]$ gfortran -o tmp1 tmp1.f90
Created attachment 8127 [details] test case
Confirmed.
I've submitted a patch at http://gcc.gnu.org/ml/gcc-patches/2005-02/msg00202.html which addresses this problem. It however introduces 16 regressions in the test suite, which I think are latent bugs in the implementation of certian intrinsic procedures.
An updated patch that does not have the regression is here http://gcc.gnu.org/ml/fortran/2005-02/msg00039.html
Subject: Bug 19754 CVSROOT: /cvs/gcc Module name: gcc Changes by: kargl@gcc.gnu.org 2005-03-05 22:13:22 Modified files: gcc/fortran : ChangeLog resolve.c Log message: PR fortran/19754 * resolve.c (compare_shapes): New function. (resolve_operator): Use it. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.344&r2=1.345 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/resolve.c.diff?cvsroot=gcc&r1=1.34&r2=1.35
Subject: Bug 19754 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: kargl@gcc.gnu.org 2005-03-05 22:18:28 Modified files: gcc/fortran : ChangeLog resolve.c Log message: PR fortran/19754 * resolve.c (compare_shapes): New function. (resolve_operator): Use it. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.335.2.7&r2=1.335.2.8 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/resolve.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.34&r2=1.34.2.1
Fixed.
(In reply to comment #7) > Fixed. Shouldn't the following test fail too with the shape conformance error message? program test integer ::a(2,2) real :: b(4,4) a=1 b=2.0 b = b + a end program test