Internal compiler bug using an array of integer(kind=1)
Tobias Burnus
burnus@net-b.de
Fri Oct 10 07:29:00 GMT 2008
Hi Sebastian,
Steve Kargl wrote:
> 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.f95:1: internal compiler error: in gfc_conv_array_initializer, at
>>
Thanks for the bug report, I opened
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37792.
> Add -fno-range-check to your compiler options.
>
> integer(1), dimension(2):: RAW_IMAGE_DATA = (/ Z'FF', Z'FF' /)
>
z'FF' = 255. The largest number which fits into integer(1) is 127 (=
huge(0_1)). If one let's the integer variable overflow
(-fno-range-check) than the bitpattern of z'FF' squeezed in the
integer(1) variable is the same as "-1".
If you want allow for such overflows, you can use -fno-range-check as
Steve already wrote. The bug is that the program causes an internal
compiler error instead of an error such as "Error: Arithmetic overflow
converting INTEGER(16) to INTEGER(1) at (1). This check can be disabled
with the option -fno-range-check".
Tobias
More information about the Fortran
mailing list