Commit bfcabc6c by Roger Sayle Committed by Roger Sayle

re PR fortran/30404 ([4.1 only] Wrong FORALL result)

2007-01-16  Roger Sayle  <roger@eyesopen.com>

	PR fortran/30404
	* trans-stmt.c (forall_info): Remove pmask field.
	(gfc_trans_forall_loop): Remove NVAR argument, instead assume that
	NVAR covers all the interation variables in the current forall_info.
	Add an extra OUTER parameter, which specified the loop header in
	which to place mask index initializations.
	(gfc_trans_nested_forall_loop): Remove NEST_FLAG argument.
	Change the semantics of MASK_FLAG to only control the mask in the
	innermost loop.
	(compute_overall_iter_number): Optimize the trivial case of a
	top-level loop having a constant number of iterations.  Update
	call to gfc_trans_nested_forall_loop.  Calculate the number of
	times the inner loop will be executed, not to size of the 
	iteration space.
	(allocate_temp_for_forall_nest_1): Reuse SIZE as BYTESIZE when
	sizeof(type) == 1.  Tidy up.
	(gfc_trans_assign_need_temp): Remove NEST_FLAG argument from calls
	to gfc_trans_nested_forall_loop.
	(gfc_trans_pointer_assign_need_temp): Likewise.
	(gfc_trans_forall_1): Remove unused BYTESIZE, TMPVAR, SIZEVAR and
	LENVAR local variables.  Split mask allocation into a separate
	hunk/pass from mask population.  Use allocate_temp_for_forall_nest
	to allocate the FORALL mask with the correct size.  Update calls
	to gfc_trans_nested_forall_loop.
	(gfc_evaluate_where_mask): Update call to
	gfc_trans_nested_forall_loop.
	(gfc_trans_where_2): Likewise.

	* gfortran.dg/forall_6.f90: New test case.
	* gfortran.dg/dependency_8.f90: Update test to find "temp" array.
	* gfortran.dg/dependency_13.f90: Likewise.


Co-Authored-By: Paul Thomas <pault@gcc.gnu.org>
Co-Authored-By: Steven G. Kargl <kargl@gcc.gnu.org>

From-SVN: r120829
parent d0768f19
2007-01-16 Roger Sayle <roger@eyesopen.com>
PR fortran/30404
* trans-stmt.c (forall_info): Remove pmask field.
(gfc_trans_forall_loop): Remove NVAR argument, instead assume that
NVAR covers all the interation variables in the current forall_info.
Add an extra OUTER parameter, which specified the loop header in
which to place mask index initializations.
(gfc_trans_nested_forall_loop): Remove NEST_FLAG argument.
Change the semantics of MASK_FLAG to only control the mask in the
innermost loop.
(compute_overall_iter_number): Optimize the trivial case of a
top-level loop having a constant number of iterations. Update
call to gfc_trans_nested_forall_loop. Calculate the number of
times the inner loop will be executed, not to size of the
iteration space.
(allocate_temp_for_forall_nest_1): Reuse SIZE as BYTESIZE when
sizeof(type) == 1. Tidy up.
(gfc_trans_assign_need_temp): Remove NEST_FLAG argument from calls
to gfc_trans_nested_forall_loop.
(gfc_trans_pointer_assign_need_temp): Likewise.
(gfc_trans_forall_1): Remove unused BYTESIZE, TMPVAR, SIZEVAR and
LENVAR local variables. Split mask allocation into a separate
hunk/pass from mask population. Use allocate_temp_for_forall_nest
to allocate the FORALL mask with the correct size. Update calls
to gfc_trans_nested_forall_loop.
(gfc_evaluate_where_mask): Update call to
gfc_trans_nested_forall_loop.
(gfc_trans_where_2): Likewise.
2007-01-15 Paul Thomas <pault@gcc.gnu.org>
PR fortran/28172
......
2007-01-16 Roger Sayle <roger@eyesopen.com>
Paul Thomas <pault@gcc.gnu.org>
Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/30404
* gfortran.dg/forall_6.f90: New test case.
* gfortran.dg/dependency_8.f90: Update test to find "temp" array.
* gfortran.dg/dependency_13.f90: Likewise.
2007-01-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
PR testsuite/12325
......@@ -9,5 +9,5 @@
x(2:5) = -42.
end where
end
! { dg-final { scan-tree-dump-times "malloc" 1 "original" } }
! { dg-final { scan-tree-dump-times "temp" 3 "original" } }
! { dg-final { cleanup-tree-dump "original" } }
......@@ -9,5 +9,5 @@ subroutine foo(a,i,j)
a(j,2:4) = 1
endwhere
end subroutine
! { dg-final { scan-tree-dump-times "malloc" 1 "original" } }
! { dg-final { scan-tree-dump-times "temp" 3 "original" } }
! { dg-final { cleanup-tree-dump "original" } }
! PR fortran/30404
! Checks that we correctly handle nested masks in nested FORALL blocks.
! Contributed by Paul Thomas <pault@gcc.gnu.org>
!
! { dg-do run }
logical :: l1(2,2)
integer :: it(2,2)
l1(:,:) = reshape ((/.false.,.true.,.true.,.false./), (/2,2/))
it(:,:) = reshape ((/1,2,3,4/), (/2,2/))
forall (i = 1:2, i < 3)
forall (j = 1:2, l1(i,j))
it(i, j) = 0
end forall
end forall
! print *, l1
! print '(4i2)', it
if (any (it .ne. reshape ((/1, 0, 0, 4/), (/2, 2/)))) call abort ()
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment