This is the mail archive of the
mailing list for the GCC project.
Re: [Patch, fortran] PR54107: ICE on recursive interfaces and PR54195: symbol bogusly inserted twice in the interface.
- From: Mikael Morin <mikael dot morin at sfr dot fr>
- To: Janus Weil <janus at gcc dot gnu dot org>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 04 Feb 2013 14:02:34 +0100
- Subject: Re: [Patch, fortran] PR54107: ICE on recursive interfaces and PR54195: symbol bogusly inserted twice in the interface.
- References: <510ED7FA.email@example.com> <CAKwh3qhPYsv9NFjYqzz77=AeqTN_rGXSUDr_n-D1CApjCYCHVA@mail.gmail.com>
Le 04/02/2013 09:37, Janus Weil a écrit :
>> - In PR54107(comment 26), the procedure result is a procedure pointer
>> whose interface is the procedure itself, which leads to an infinite
>> recursion during resolution.
>> - In PR54195, a type's type bound procedures are resolved twice, leading
>> to a symbol being added twice in an interface and rejected.
> What about PR 54107 comment 4?
Ah, yes, this patch fixes comment26 only.
> This also still fails, right? You had
> already posted a patch for this in this PR, which however was quite
> different from the one you propose here. (I was assuming that the
> problems of comment 4 and comment 26 were quite similar.)
Well, that's what I thought and I even developed a patch limited to
trans-types.c and supposed to fix both. But it turned out that it
didn't, as comment26 is a recursion during resolution while comment4 is
a recursion during translation. I didn't investigate the reasons why
comment26 doesn't recurse during translation; I suppose it's caused by
code like this (several instances):
if (sym->attr.proc_pointer && /* whatever */)
sym->attr.proc_pointer = 0;
type = build_pointer_type (gfc_get_function_type (sym));
sym->attr.proc_pointer = 1;
> Can your 'resolved' attribute also help to fix comment 4, or are you
> going to post the other patch later?
It can't really help for the reasons above; at the time we start
translation, all the symbols are resolved, so if we reuse that flag, we
have to clear it somewhere, so that it doesn't really mean 'resolved'
any more. I'll post the other patch later.
>> The fix, as discussed in PR54195, adds a flag to mark a symbol as
> Why not add this flag directly to gfc_symbol instead of
> symbol_attribute? It seems we do not need the attribute for components
> (or do we?).
Hum, indeed. symbol_attribute, despite its name, also applies to
OK, I'll move the flag to gfc_symbol.
Thanks for the review.