re PR fortran/22327 ([4.0 only] Wrong code in array constructor)

2005-07-07  Feng Wang  <fengwang@nudt.edu.cn>

	PR fortran/22327
	* trans-array.c (gfc_trans_array_constructor_value): Fix index of data.

2005-07-07  Feng Wang  <fengwang@nudt.edu.cn>

	PR fortran/22327
	* gfortran.dg/array_constructor_5.f90: New test.

From-SVN: r101682
This commit is contained in:
Feng Wang 2005-07-07 01:56:04 +00:00 committed by Feng Wang
parent 9c8f9ec21b
commit 9f9d4c5f50
4 changed files with 22 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2005-07-07 Feng Wang <fengwang@nudt.edu.cn>
PR fortran/22327
* trans-array.c (gfc_trans_array_constructor_value): Fix index of data.
2005-07-07 Jakub Jelinek <jakub@redhat.com>
* decl.c (gfc_match_entry): Allow ENTRY without parentheses

View File

@ -862,7 +862,7 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type,
gfc_add_expr_to_block (&body, tmp);
*poffset = fold_build2 (PLUS_EXPR, gfc_array_index_type,
*poffset, bound);
*poffset, build_int_cst (NULL_TREE, n));
}
if (!INTEGER_CST_P (*poffset))
{

View File

@ -1,3 +1,8 @@
2005-07-07 Feng Wang <fengwang@nudt.edu.cn>
PR fortran/22327
* gfortran.dg/array_constructor_5.f90: New test.
2005-07-07 Jakub Jelinek <jakub@redhat.com>
* gfortran.fortran-torture/execute/entry_9.f90: New test.

View File

@ -0,0 +1,11 @@
! { dg-do run }
! PR22327
program array_constructor
implicit none
integer :: a(6), i
i = 6
a = (/ 1, 2, 3, 4, 5, i /)
do i = 1, 6
if (a(i) /= i) call abort()
end do
end program array_constructor