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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208033
138bc75d-0d04-0410-961f-
82ee72b054a4
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
* gfortran.h (gfc_build_class_symbol): Removed argument.
* class.c (gfc_add_component_ref): Fix up missing vtype if necessary.
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)
+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.
--- /dev/null
+! { 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