re PR fortran/37792 (ICE in gfc_conv_array_initializer; works with -fno-range-check)

2008-10-12  Steven G. Kargl  <kargls@comcast.net>

	PR fortran/37792
	* fortran/resolve.c (resolve_fl_variable): Simplify the
	initializer if there is one.

2008-10-12  Steven G. Kargl  <kargls@comcast.net>

	PR fortran/37792
	* gfortran.dg/arithmetic_overflow_1.f90: New test.

From-SVN: r141072
This commit is contained in:
Steven G. Kargl 2008-10-12 09:38:18 +00:00 committed by Paul Thomas
parent 35fced0142
commit 7a99defe0d
4 changed files with 25 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2008-10-12 Steven G. Kargl <kargls@comcast.net>
PR fortran/37792
* fortran/resolve.c (resolve_fl_variable): Simplify the
initializer if there is one.
2008-10-11 Paul Thomas <pault@gcc.gnu.org>
PR fortran/37794

View File

@ -7525,6 +7525,10 @@ resolve_fl_variable (gfc_symbol *sym, int mp_flag)
}
}
/* Ensure that any initializer is simplified. */
if (sym->value)
gfc_simplify_expr (sym->value, 1);
/* Reject illegal initializers. */
if (!sym->mark && sym->value)
{

View File

@ -1,3 +1,8 @@
2008-10-12 Steven G. Kargl <kargls@comcast.net>
PR fortran/37792
* gfortran.dg/arithmetic_overflow_1.f90: New test.
2008-10-11 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/loop_optimization5.adb: New test.

View File

@ -0,0 +1,10 @@
! { dg-do compile }
! Fixes PR37787 where the arithmetic overflow was not detected and an ICE ensued.
!
! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
!
program bug
implicit none
integer(1) :: a(2) = (/ Z'FF', Z'FF' /) ! { dg-error "Arithmetic overflow" }
print*, a
end program bug