> -----Original Message-----
> From: Eric Botcazou <ebotca...@adacore.com>
> Sent: March 4, 2020 6:18 AM
> To: Richard Wai <rich...@annexi-strayline.com>
> Cc: gcc-patches@gcc.gnu.org
> Subject: Re: [PATCH] Ada: gcc-interface: fixed assertion for aliased
entities
> 
> > I'll have to look into this.. Any pointers? This assertion is not a
> > language rule assertion.
> 
> Of course, neither of the 117 assertions in gcc-interface is, instead they
are
> assertions meant to prevent wrong-code generation from occuring.
> 

Please excuse my ignorance as this is my first (and hopefully not last)
patch submission.. But I don't see any testcases in the Ada testsuite except
for the (outdated) ACATS tests, which doesn't cover this assertion. So I'm
honestly not sure how I should go about that..

> > As you see, the assertion being modified already tests for
> > "Is_Public". So the issue is precisely that this assertion wrongly
> > fails for cases where the entity is not Public.
> 
> We cannot let anything go through if there is not Is_Public set somewhere,
> possibly on the Alias (gnat_entity) since it is present in your case.
>  

My reasoning there was that at decl.c:3914 when the E_Function/E_Procedure
that has alias is resolved, there is a recursive call to gnat_to_gnu_entity
on the alias. So if the alias was not Public, the same assertion will be
triggered on that recursive call, so there seems to be no need to check it
at that point. Though I suppose that could leave some holes if the incoming
entity is not a subprogram!

Shall I add the Is_Public check to the Alias and resubmit the patch?

Richard Wai
ANNEXI-STRAYLINE

Reply via email to