mirror of git://gcc.gnu.org/git/gcc.git
re PR fortran/56907 (C_LOC shall not call internal-PACK when an array argument is used)
2013-04-20 Tobias Burnus <burnus@net-b.de>
PR fortran/56907
* trans-intrinsic.c (conv_isocbinding_function): Don't pack
* array
passed to C_LOC
2013-04-20 Tobias Burnus <burnus@net-b.de>
PR fortran/56907
* gfortran.dg/c_loc_test_22.f90: New.
From-SVN: r198109
This commit is contained in:
parent
21ec136ace
commit
6fbcd30990
|
|
@ -1,3 +1,9 @@
|
|||
2013-04-20 Tobias Burnus <burnus@net-b.de>
|
||||
|
||||
PR fortran/56907
|
||||
* trans-intrinsic.c (conv_isocbinding_function): Don't pack array
|
||||
passed to C_LOC
|
||||
|
||||
2013-04-19 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||
Mikael Morin <mikael@gcc.gnu.org>
|
||||
|
||||
|
|
|
|||
|
|
@ -6317,8 +6317,13 @@ conv_isocbinding_function (gfc_se *se, gfc_expr *expr)
|
|||
{
|
||||
if (arg->expr->rank == 0)
|
||||
gfc_conv_expr_reference (se, arg->expr);
|
||||
else
|
||||
else if (gfc_is_simply_contiguous (arg->expr, false))
|
||||
gfc_conv_array_parameter (se, arg->expr, true, NULL, NULL, NULL);
|
||||
else
|
||||
{
|
||||
gfc_conv_expr_descriptor (se, arg->expr);
|
||||
se->expr = gfc_conv_descriptor_data_get (se->expr);
|
||||
}
|
||||
|
||||
/* TODO -- the following two lines shouldn't be necessary, but if
|
||||
they're removed, a bug is exposed later in the code path.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
2013-04-20 Tobias Burnus <burnus@net-b.de>
|
||||
|
||||
PR fortran/56907
|
||||
* gfortran.dg/c_loc_test_22.f90: New.
|
||||
|
||||
2013-04-19 Vladimir Makarov <vmakarov@redhat.com>
|
||||
|
||||
PR rtl-optimization/56847
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
! { dg-do compile }
|
||||
! { dg-options "-fdump-tree-original" }
|
||||
!
|
||||
! PR fortran/56907
|
||||
!
|
||||
subroutine sub(xxx, yyy)
|
||||
use iso_c_binding
|
||||
implicit none
|
||||
integer, target, contiguous :: xxx(:)
|
||||
integer, target :: yyy(:)
|
||||
type(c_ptr) :: ptr1, ptr2, ptr3, ptr4
|
||||
ptr1 = c_loc (xxx)
|
||||
ptr2 = c_loc (xxx(5:))
|
||||
ptr3 = c_loc (yyy)
|
||||
ptr4 = c_loc (yyy(5:))
|
||||
end
|
||||
! { dg-final { scan-tree-dump-not " _gfortran_internal_pack" "original" } }
|
||||
! { dg-final { scan-tree-dump-times "parm.\[0-9\]+.data = \\(void .\\) &\\(.xxx.\[0-9\]+\\)\\\[0\\\];" 1 "original" } }
|
||||
! { dg-final { scan-tree-dump-times "parm.\[0-9\]+.data = \\(void .\\) &\\(.xxx.\[0-9\]+\\)\\\[D.\[0-9\]+ \\* 4\\\];" 1 "original" } }
|
||||
! { dg-final { scan-tree-dump-times "parm.\[0-9\]+.data = \\(void .\\) &\\(.yyy.\[0-9\]+\\)\\\[0\\\];" 1 "original" } }
|
||||
! { dg-final { scan-tree-dump-times "parm.\[0-9\]+.data = \\(void .\\) &\\(.yyy.\[0-9\]+\\)\\\[D.\[0-9\]+ \\* 4\\\];" 1 "original" } }
|
||||
|
||||
! { dg-final { scan-tree-dump-times "D.\[0-9\]+ = parm.\[0-9\]+.data;\[^;]+ptr\[1-4\] = D.\[0-9\]+;" 4 "original" } }
|
||||
! { dg-final { cleanup-tree-dump "optimized" } }
|
||||
Loading…
Reference in New Issue