This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug fortran/35681] wrong result for vector subscripted array expression in MVBITS



------- Comment #1 from fxcoudert at gcc dot gnu dot org  2008-03-28 15:18 -------
Reduced testcase:

  integer, dimension(10) :: ILA1 = (/1,2,3,4,5,6,7,8,9,10/)
  call mvbits ((ILA1((/9,9,6,2,4,9,2,9,6,10/))), 2, 4, ILA1, 3)
  write (*,'(10(I3))') ila1
  end 

output is:
   17 18 11 36 77 22 39 16 41 18
while it should be:
   17 18 11  4 13 22  7 16  9 18


I don't know if it related, but the following compiles and segfault at runtime:

  integer, dimension(10) :: ILA1 = (/1,2,3,4,5,6,7,8,9,10/)
  call mvbits ((ILA1((/9/))), 2, 4, ILA1, 3)
  write (*,'(10(I3))') ila1
  end 

while it gives a strange error message with -fbounds-check:

At line 2 of file a.f90
Fortran runtime error: Array reference out of bounds for array 'ila1', upper
bound of dimension 1  exceeded (68 > 10)


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org


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


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