[Patch, Fortran, F08] PR45290: pointer initialization

Janus Weil janus@gcc.gnu.org
Tue Aug 17 21:48:00 GMT 2010


> But adding this patchlet:
>
>
> Index: gcc/fortran/primary.c
> ===================================================================
> --- gcc/fortran/primary.c       (revision 163310)
> +++ gcc/fortran/primary.c       (working copy)
> @@ -2017,8 +2017,6 @@ gfc_variable_attr (gfc_expr *expr, gfc_typespec *t
>     }
>
>   target = attr.target;
> -  if (pointer || attr.proc_pointer)
> -    target = 1;
>
>   if (ts != NULL && expr->ts.type == BT_UNKNOWN)
>     *ts = sym->ts;
> @@ -2074,8 +2072,6 @@ gfc_variable_attr (gfc_expr *expr, gfc_typespec *t
>            pointer = comp->attr.pointer;
>            allocatable = comp->attr.allocatable;
>          }
> -       if (pointer || attr.proc_pointer)
> -         target = 1;
>
>        break;
>
>
> gives me a couple of regressions:
>
>
> FAIL: gfortran.fortran-torture/execute/ptr.f90 compilation,  -O0
> FAIL: gfortran.dg/c_loc_tests_14.f90  -O  (test for excess errors)
> FAIL: gfortran.dg/c_loc_tests_5.f03  -O  (test for excess errors)
> FAIL: gfortran.dg/pointer_assign_4.f90  -O0  (test for excess errors)
> FAIL: gfortran.dg/pr43984.f90  -O  (test for excess errors)
> FAIL: gfortran.dg/subref_array_pointer_1.f90  -O0  (test for excess errors)
>
> All of them, except the C_LOC ones, fail on pointer assignments. And I
> think all of them are actually invalid.


Here is an updated patch, which fixes the invalid test cases. It
should be free of regressions.

Ok so far?

I will re-check for regressions and take care of implicit SAVE in
PROGRAMS tomorrow.

Cheers,
Janus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr45290_v4.diff
Type: application/octet-stream
Size: 18548 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20100817/8b483f9b/attachment.obj>


More information about the Fortran mailing list