[Patch, fortran] PR42309 - Problem with a pointer array passed to a subroutine

H.J. Lu hjl.tools@gmail.com
Sun Feb 7 00:33:00 GMT 2010


On Tue, Feb 2, 2010 at 9:51 PM, Paul Richard Thomas
<paul.richard.thomas@gmail.com> wrote:
> This is another one of our serious bugs and yet another that can only
> be properly fixed by array descriptor reform.  A dummy, pointer
> argument is expected to have unity lbounds, with an appropriate
> offset, and this patch makes it so.  The fix has the advantage of
> fixing, if not a corner case, certainly something quite unusual;
> therefore, the likelihood of regression is small..... on geological
> timescales.
>
> Bootstrapped and regtested on FC9/x86_64 - OK for trunk and 4.4?
>
> Paul
>
> 2010-02-03  Paul Thomas  <pault@gcc.gnu.org>
>
>        PR fortran/42309
>        * trans-expr.c (gfc_conv_subref_array_arg): Add new argument
>        'formal_ptr'. If this is true, give returned descriptor unity
>        lbounds, in all dimensions, and the appropriate offset.
>        (gfc_conv_procedure_call); If formal is a pointer, set the last
>        argument of gfc_conv_subref_array_arg to true.
>        * trans.h : Add last argument for gfc_conv_subref_array_arg.
>        * trans-io.c (set_internal_unit, gfc_trans_transfer): Set the
>        new arg of gfc_conv_subref_array_arg to false.
>        * trans-stmt.c (forall_make_variable_temp): The same.
>
> 2010-02-03  Paul Thomas  <pault@gcc.gnu.org>
>
>        PR fortran/42309
>        * gfortran.dg/subref_array_pointer_4.f90 : New test.
>

The new test failed at -O3 -g on gcc 4.4 under Linux/x86.


-- 
H.J.



More information about the Gcc-patches mailing list