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

Re: Internal compiler bug using an array of integer(kind=1)


On Fri, Oct 10, 2008 at 12:09:37AM +0200, Sebastian Gallinat wrote:
> 
> c:\silverbox\archiv\lib\libharu\gfortran\demo\mixed>gfortran bug.f95 -o 
> bug -Wall
> bug.f95: In function 'bug':
> bug.f95:1: internal compiler error: in gfc_conv_array_initializer, at 
> fortran/trans-array.c:3893
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.
> 

Add -fno-range-check to your compiler options.

troutmask:sgk[216] gfc4x -o z -fno-range-check a.f90
troutmask:sgk[217] ./z
   -1   -1
troutmask:sgk[218] cat a.f90
   program bug
   implicit none
   integer(1), dimension(2):: RAW_IMAGE_DATA = (/ Z'FF', Z'FF' /)
   print*, RAW_IMAGE_DATA
   end program bug
troutmask:sgk[219] gfortran42 -o z a.f90
a.f90: In function 'MAIN__':
a.f90:1: internal compiler error: in gfc_conv_array_initializer, at fortran/trans-array.c:3516
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
troutmask:sgk[220] gfortran42 -o z -fno-range-check a.f90
troutmask:sgk[221] ./z
   -1   -1


The problem is Z'FF' overflows a INTEGER(1) variable.
An error message should be issued, but it appears to
be suppressed.  gfc_conv_array_initializer is then
given a messed data structure.

-- 
Steve


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