This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/44978] derived types are resolved more than once


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44978

--- Comment #17 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
In what follows "Janus' patch" will refer to
http://gcc.gnu.org/bugzilla/attachment.cgi?id=30629
and "Mikael's patch" to
http://gcc.gnu.org/bugzilla/attachment.cgi?id=30633

Although there are still duplicate errors, both patches regtest cleanly and are
a significant improvement. I have seen the following differences between the
two patches (I'll attach the full differences):

(1) pr43591, Mikael's patch output the additional error

pr43591.f90:8.77:

     procedure(number_flavor_states), nopass, pointer :: number_flavor_states
=> NULL()
                                         1
Error: Interface 'number_flavor_states' at (1) must be explicit

For both patches the error

pr43591.f90:15.23:

    integer, dimension(physical%number_particles_out(), &
               1
Error: Expression at (1) must be of INTEGER type, found UNKNOWN

is printed twice.

(2) pr48095, the error

pr48095.f90:7.79:

    procedure(get_area), pointer, pass(this) :: get_special_area => get_my_area
                                           1
Error: Interface mismatch in procedure pointer assignment at (1): Type mismatch
in argument 'this' (CLASS(rectangle)/TYPE(rectangle))

is printed three times with Janus' patch and only twice with Mikael's one.

(3) pr55983, with Janus' patch, the last error is

pr55983.f90:16.32:

    class(bcd_t), pointer :: bcx, bcy
                1
Error: The pointer component 'bcx' of '__class_solver_mpdata_m_Mpdata_t' at (1)
is a type that has not been declared

while with Mikael's patch it is

pr55983.f90:16.37:

    class(bcd_t), pointer :: bcx, bcy
                     1
Error: The pointer component 'bcy' of 'mpdata_t' at (1) is a type that has not
been declared

For a clean tree it is

    class(bcd_t), pointer :: bcx, bcy
                                1
Error: The pointer component 'bcx' of 'mpdata_t' at (1) is a type that has not
been declared

(4) pr58023, compiling both tests with Janus' patch gives an ICE, while with
Mikale's patch the first test gives a second error

pr58023.f90:11.34:

     procedure(mr), pointer :: mr2
                  1
Error: Procedure pointer component 'mr2' with PASS at (1) must have at least
one argument

> I also took the opportunity to extend your pr51945 change (hunk below) 
> to the whole loop.

This also fixes pr58023#c0. pr58023#c1 is fixed if I replace the following
hunks

@@ -12024,7 +12036,8 @@ resolve_fl_derived0 (gfc_symbol *sym)
       gfc_error ("Component '%s' at %L with coarray component "
              "shall be a nonpointer, nonallocatable scalar",
              c->name, &c->loc);
-      return false;
+      retval = false;
+      continue;
     }

       /* F2008, C448.  */
@@ -12032,7 +12045,8 @@ resolve_fl_derived0 (gfc_symbol *sym)
     {
       gfc_error ("Component '%s' at %L has the CONTIGUOUS attribute but "
              "is not an array pointer", c->name, &c->loc);
-      return false;
+      retval = false;
+      continue;
     }

       if (c->attr.proc_pointer && c->ts.interface)

with


@@ -12031,16 +12035,20 @@ resolve_fl_derived0 (gfc_symbol *sym)
     {
       gfc_error ("Component '%s' at %L has the CONTIGUOUS attribute but "
              "is not an array pointer", c->name, &c->loc);
-      return false;
+      retval = false;
+      continue;
     }

       if (c->attr.proc_pointer && c->ts.interface)
     {
       gfc_symbol *ifc = c->ts.interface;

-      if (!sym->attr.vtype
-          && !check_proc_interface (ifc, &c->loc))
-        return false;
+      if (!sym->attr.vtype && !check_proc_interface (ifc, &c->loc))
+        {
+          c->tb->error = 1;
+          retval = false;
+          continue;
+        }

       if (ifc->attr.if_source || ifc->attr.intrinsic)
         {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]