https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99602

--- Comment #28 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to Jürgen Reuter from comment #27)
> Created attachment 50432 [details]
> reproducer, down to 6800 lines

Hi Juergen,

Stop! Yesterday's final is just fine. The problem is connected with the logic
selecting the runtime error. The code for line 483 ends with

                      D.5856 = model->_vptr->get_par_data_ptr (&model.110,
D.5855);
                      if ((character(kind=1)[0:][1:1] * restrict)
D.5855->chars.data != 0B)
                        {
                          __builtin_free ((void *) D.5855->chars.data);
                          (character(kind=1)[0:][1:1] * restrict)
D.5855->chars.data = 0B;
                        }
                      if ((integer(kind=8)) (D.5856._data == 0B))
                        {
                          _gfortran_runtime_error_at (&"At line 483 of file
models.f90"[1]{lb: 1 sz: 1}, &"Proc-pointer actual argument \'model\' is not
associated"[1]{lb: 1 sz: 1});
                        }
                      field_data_set (&class.109, 0B, 0B, 0B, 0B, 0B, 0B, 0B,
0B, 0B, 0B, 0B, 0B, 0B, 0B, 0B, 0B, 0B, 0B, 0B, 0B, 0B, 0B, 0B, &D.5856, 0B,
0B, 0B);
                    }

The _data field of D.5856 is the result of the call to 'get_par_data_ptr' not
the procedure pointer itself. The result is:
class(modelpar_data_t), pointer :: ptr and the formal argument is:
class(modelpar_data_t), intent(in), pointer, optional :: mass_data

So the call is perfectly proper. The trouble is that the attributes of the
proc_pointer result are not being used.

I am about to start a gdb session :-)

Paul

Reply via email to