Assigning a scalar to a slice arr(:,1) of a two-dimensional array, e.g.
  arr(:,1) = 0.
actually assigns that value to the whole array.

The attached code prints
   1.000000       1.000000       1.000000       1.000000    
   0.000000       0.000000       0.000000       0.000000    
instead of
   1.000000       1.000000       1.000000       1.000000    
   0.000000       1.000000       0.000000       1.000000    

My version:
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/wdobler/opt/misc/gfortran
--enable-languages=fortran --host=x86_64-pc-linux-gnu
--build=x86_64-pc-linux-gnu --disable-altivec --enable-nls
--without-included-gettext --with-system-zlib --disable-checking
--disable-werror --enable-secureplt --disable-libunwind-exceptions
--disable-multilib --disable-libmudflap --disable-libssp --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.3.0 20070426 (experimental)


-- 
           Summary: Assignment to array slice affects whole array
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: wdobler at ucalgary dot ca
GCC target triplet: x86_64-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31732

Reply via email to