This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR c/7622
Gabriel Dos Reis wrote:
>
> Eric Botcazou <ebotcazou@libertysurf.fr> writes:
>
> | The faulty definition of the nested bar() should be flagged earlier during
> | parsing I think (see c-decl.c:finish_decl).
I think it cannot be flagged by that time because it is just a forward
nested declare I beleive that genrtl_scope_stmt is the right time to
check everything is in place. I do not clearly see when the lack of a
definition of a auto nested function can be checked before, I am
realatively new to gcc internals so
it may be wrong, in that case I would appreciate if you spotted me out
where we could do such a test.
> This is basically what rth said way back then.
>
> | > (my proposed patch for alias PR c/7490 was dealing with this issue also)
> |
> | I've now read it. It seems that we agree that output_inline_function must be
> | guarded by the check on DECL_SAVED_INSNS (fn).
In fact I was just spotting the fact that the patch could hide some
unwanted behaviour. By the way what do you think about adding a warning
saying that gcc just forget the definition in
toplev.c:rest_of_compilation instead. do you think it is a good idea?
>
> yeah. Actually, by the time we get to emitting function definitions
> we should already be in state to do so, i.e. no error, every
> required definition seen, etc. If we keep that invariant, then the
> check is unncessary. Said differently, the check is just papering
> over the root of the problem.
>
> | name than the original one, by using the "alias" attribute. But, as Richard
> | pointed out, the "alias" attribute is a definition, not a declaration. So we
> | should again flag the error earlier.
>
> 100% agreed.
>
I understand this point, but as there is no mangement of asm symbols it
is quite hard perform any check, I am trying to understand asm symbols
emission and see if I can build something like this. we can just forbid
the use of alias in nested scope because for the time being.
a+ thanks for any futher explanations
--Philippe