[Bug fortran/44135] Negative array bounds lead to spurious warning

2010-05-14 Thread thomasr at nikhef dot nl


--- Comment #1 from thomasr at nikhef dot nl  2010-05-14 09:24 ---
Created an attachment (id=20660)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20660&action=view)
Test program that reproduces the bug


-- 


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



[Bug fortran/44135] New: Negative array bounds lead to spurious warning

2010-05-14 Thread thomasr at nikhef dot nl
The declaration of arrays with negative bounds leads to a warning message,
probably caused by an integer overflow. The program below leads to the message

gprogram.f90:6.19:

   call fill_array(my_arr)
   1
Warning: Actual argument contains too few elements for dummy argument 'arr'
(3/4294967295) at (1)


program gprogram
   implicit none

   double precision, dimension(-2:0) :: my_arr

   call fill_array(my_arr)
   print*, my_arr(-2)
   print*, my_arr(-1)
   print*, my_arr( 0)
contains
   subroutine fill_array(arr)
  implicit none
  double precision, dimension(-2:0), intent(out) :: arr

  arr(-2) = 1.0d0
  arr(-1) = 3.1d0
  arr( 0) = 9.2d0
   end subroutine fill_array
end program gprogram


-- 
   Summary: Negative array bounds lead to spurious warning
   Product: gcc
   Version: 4.4.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: thomasr at nikhef dot nl
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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