re PR fortran/60302 (ICE with c_f_pointer and android cross compiler)
2014-02-21 Janus Weil <janus@gcc.gnu.org> PR fortran/60302 * check.c (gfc_check_c_f_pointer): Only clear 'size' if 'gfc_array_size' is successful. 2014-02-21 Janus Weil <janus@gcc.gnu.org> PR fortran/60302 * gfortran.dg/c_f_pointer_shape_tests_6.f90: New. From-SVN: r208033
This commit is contained in:
parent
d723358d01
commit
f1ed9e151e
@ -1,3 +1,9 @@
|
||||
2014-02-21 Janus Weil <janus@gcc.gnu.org>
|
||||
|
||||
PR fortran/60302
|
||||
* check.c (gfc_check_c_f_pointer): Only clear 'size' if 'gfc_array_size'
|
||||
is successful.
|
||||
|
||||
2014-02-21 Janus Weil <janus@gcc.gnu.org>
|
||||
|
||||
PR fortran/60234
|
||||
|
@ -3944,16 +3944,17 @@ gfc_check_c_f_pointer (gfc_expr *cptr, gfc_expr *fptr, gfc_expr *shape)
|
||||
if (shape)
|
||||
{
|
||||
mpz_t size;
|
||||
|
||||
if (gfc_array_size (shape, &size)
|
||||
&& mpz_cmp_ui (size, fptr->rank) != 0)
|
||||
if (gfc_array_size (shape, &size))
|
||||
{
|
||||
if (mpz_cmp_ui (size, fptr->rank) != 0)
|
||||
{
|
||||
mpz_clear (size);
|
||||
gfc_error ("SHAPE argument at %L to C_F_POINTER must have the same "
|
||||
"size as the RANK of FPTR", &shape->where);
|
||||
return false;
|
||||
}
|
||||
mpz_clear (size);
|
||||
gfc_error ("SHAPE argument at %L to C_F_POINTER must have the same "
|
||||
"size as the RANK of FPTR", &shape->where);
|
||||
return false;
|
||||
}
|
||||
mpz_clear (size);
|
||||
}
|
||||
|
||||
if (fptr->ts.type == BT_CLASS)
|
||||
|
@ -1,3 +1,8 @@
|
||||
2014-02-21 Janus Weil <janus@gcc.gnu.org>
|
||||
|
||||
PR fortran/60302
|
||||
* gfortran.dg/c_f_pointer_shape_tests_6.f90: New.
|
||||
|
||||
2014-02-21 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
|
||||
|
||||
* gcc.dg/vmx/vsums.c: Check entire result vector.
|
||||
|
14
gcc/testsuite/gfortran.dg/c_f_pointer_shape_tests_6.f90
Normal file
14
gcc/testsuite/gfortran.dg/c_f_pointer_shape_tests_6.f90
Normal file
@ -0,0 +1,14 @@
|
||||
! { dg-do compile }
|
||||
!
|
||||
! PR 60302: [4.9 Regression] ICE with c_f_pointer and android cross compiler
|
||||
!
|
||||
! Contributed by Valery Weber <valeryweber@hotmail.com>
|
||||
|
||||
subroutine reshape_inplace_c2_c2 (new_shape)
|
||||
use, intrinsic :: iso_c_binding
|
||||
implicit none
|
||||
integer :: new_shape(:)
|
||||
complex, pointer :: ptr_x(:)
|
||||
type(c_ptr) :: loc_x
|
||||
call c_f_pointer (loc_x, ptr_x, new_shape)
|
||||
end subroutine
|
Loading…
Reference in New Issue
Block a user