Re: [Patch, Fortran] PR56907 - do not 'pack' arrays passed to C_LOC

2013-04-20 Thread Janus Weil
>>> Well, it does: As it doesn't know whether the array is contiguous or not >>> - it packs the array. That's what one usually wants. However, for C_LOC one >>> knows that the array is contiguous - the user promises this to the compiler >>> - and, hence, no packing is needed. >> >> Ok, I see. Then

Re: [Patch, Fortran] PR56907 - do not 'pack' arrays passed to C_LOC

2013-04-20 Thread Tobias Burnus
Am 20.04.2013 12:42, schrieb Janus Weil: Well, it does: As it doesn't know whether the array is contiguous or not - it packs the array. That's what one usually wants. However, for C_LOC one knows that the array is contiguous - the user promises this to the compiler - and, hence, no packing is n

Re: [Patch, Fortran] PR56907 - do not 'pack' arrays passed to C_LOC

2013-04-20 Thread Janus Weil
>> What I don't quite understand is: >> @@ -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)) >

Re: [Patch, Fortran] PR56907 - do not 'pack' arrays passed to C_LOC

2013-04-19 Thread Tobias Burnus
Janus Weil: What I don't quite understand is: @@ -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_c

Re: [Patch, Fortran] PR56907 - do not 'pack' arrays passed to C_LOC

2013-04-19 Thread Janus Weil
Hi Tobias, > Fortran 2008 supports C_LOC(array); if the argument is not simply > contiguous, the current code adds a call to __gfortran_intrinsic_pack. > > The pack call shouldn't be there. Fortran 2008 demands that the actual > argument is contiguous and intrinsic_pack copy creates a copy if the

*ping* - Re: [Patch, Fortran] PR56907 - do not 'pack' arrays passed to C_LOC

2013-04-15 Thread Tobias Burnus
*ping* Also pending is the NO_ARGS_CHECK patch at: http://gcc.gnu.org/ml/fortran/2013-04/msg00120.html On April 10, Tobias Burnus wrote: Fortran 2008 supports C_LOC(array); if the argument is not simply contiguous, the current code adds a call to __gfortran_intrinsic_pack. The pack call sh