This is the mail archive of the gcc-patches@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]

Re: [Patch, Fortran, OOP] PR 56261: seg fault call procedure pointer on polymorphic array


2013/4/11 Tobias Burnus <burnus@net-b.de>:
> Am 11.04.2013 16:23, schrieb Janus Weil:
>
>>> [Btw, I also thought about doing a full "gfc_compare_interfaces" in
>>> "resolve_global_procedure", but that would probably be too strict.]
>>
>> Comment to self: It's certainly more strict, but I think this is a
>> good thing. I just tried it and in fact it catches a number of cases
>> in the testsuite, which previously went unnoticed.
>
> Comment to Janus: It should be possible to disable the error check, e.g. by
> making it a warning.

Yeah, certainly not a bad idea.


> That's actually what the current code does: By default,
> it only warns and does not print an error.

No, at least the type mismatch and char-len checks always seem to
throw an error ...


> Thus, I think one should be strict about the requires-explicit-interface
> diagnostic (= new code, using F90+), but for interface mismatch (= could be
> old Fortran 66 code),  it should be either disabled or - as currently - just
> be a warning.

How about enabling it by default, but having -std=legacy disable the checks?

I'm now using:

      if (!(gfc_option.warn_std & GFC_STD_LEGACY))
    gfc_errors_to_warnings (1);

      if (!gfc_compare_interfaces (sym, def_sym, sym->name, 0, 1,
                   reason, sizeof(reason), NULL, NULL))
    gfc_error ("Interface mismatch in global procedure '%s' at %L: %s ",
           sym->name, &sym->declared_at, reason);


> Regarding your other patch - I haven't looked at the current patch:

Your remaining comments only apply to the old version of the patch
(which is obsolete).


I wrote:

> The remaining failures are:
>
> FAIL: gfortran.dg/import2.f90  -O  (test for excess errors)
> FAIL: gfortran.dg/import6.f90  -O  (test for excess errors)
> FAIL: gfortran.dg/global_references_
> 1.f90  -O   (test for errors, line 35)
> FAIL: gfortran.dg/global_references_1.f90  -O  (test for excess errors)
> FAIL: gfortran.dg/function_types_3.f90  -O  (test for excess errors)

The first one (import2.f90) was just some kind of follow-up error to a
rejected declaration, which can be avoided by removing some parts of
the test case (which do not really have any purpose there).

The second one (import6.f90) is rejected via gfc_compare_derived_types
and actually invalid IIUC. Can be made valid by adding SEQUENCE to all
types.

For the last two, I just amended the dg-errors.

With these additions, the patch should finally be regression free (I'm
in the process of double-checking this). Ok for trunk?

Cheers,
Janus

Attachment: pr56261_v7.diff
Description: Binary data


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