Commit cc2804f1 by Andrew Pinski Committed by Andrew Pinski

trans-stmt.c (gfc_trans_pointer_assign_need_temp): Use fold_convert to avoid type mismatch.

2006-01-09  Andrew Pinski  <pinskia@physics.uc.edu>

        fortran/24936
        * trans-stmt.c (gfc_trans_pointer_assign_need_temp): Use fold_convert
        to avoid type mismatch.


2006-01-09  Andrew Pinski  <pinskia@physics.uc.edu>

        fortran/24936
        * gfortran.dg/forall_3.f90: New test.

From-SVN: r109508
parent 76150104
2006-01-09 Andrew Pinski <pinskia@physics.uc.edu>
fortran/24936
* trans-stmt.c (gfc_trans_pointer_assign_need_temp): Use fold_convert
to avoid type mismatch.
2006-01-09 Andrew Pinski <pinskia@physics.uc.edu>
PR fortran/21977
* trans-decl.c (gfc_generate_function_code): Move the NULLing of
current_fake_result_decl down to below generate_local_vars.
......
......@@ -2122,7 +2122,8 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2,
rse.want_pointer = 1;
gfc_conv_expr (&rse, expr2);
gfc_add_block_to_block (&body, &rse.pre);
gfc_add_modify_expr (&body, lse.expr, rse.expr);
gfc_add_modify_expr (&body, lse.expr,
fold_convert (TREE_TYPE (lse.expr), rse.expr));
gfc_add_block_to_block (&body, &rse.post);
/* Increment count. */
......
2006-01-09 Andrew Pinski <pinskia@physics.uc.edu>
fortran/24936
* gfortran.dg/forall_3.f90: New test.
2006-01-09 Andrew Pinski <pinskia@physics.uc.edu>
PR fortran/21977
* gfortran.dg/nesting_2.f90: New test.
* gfortran.dg/nesting_3.f90: New test.
! the problem here was that we had forgot to call
! fold_convert in gfc_trans_pointer_assign_need_temp
! so that we got a pointer to char instead of a
! pointer to an array
! we really don't need a temp here.
! { dg-do compile }
program test_forall
type element
character(32), pointer :: name
end type element
type(element) :: charts(50)
character(32), target :: names(50)
forall(i=1:50)
charts(i)%name => names(i)
end forall
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