[Bug ada/69219] [5/6 regression] failed to compile nested subprograms with Inline_Always and Intrinsic

ebotcazou at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 12 09:19:00 GMT 2016


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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
   Last reconfirmed|                            |2016-01-12
         Resolution|INVALID                     |---
     Ever confirmed|0                           |1

--- Comment #6 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> I believe above "IA" is a sufficiently small subprogram because it's one
> line!

Indeed, I somehow thought that NI was nested in IA...

> 1. The compiler rejects the code that seems syntactically legal, and this
> behavior is depending on the place where the subprogram is instantiated.
> There is no reason why it is accepted in the library-level and rejected in
> the nested scope, especially when the pragmas are written in the generic
> package practically.

pragma Inline_Always is not defined by the Ada language so you cannot invoke
legality rules when you use it.  It will issue an error when it cannot inline
something and, yes, this depends on the context.

> 2. The error message is confused. "<built-in>" is one too.
> I wish that "Intrinsic" is reported if Intrinsic is the cause.

Not easily doable so not worth the pain.

> And the other lines are also unclear.
> 
> > <built-in>: In function 'nestedinlinealways.ia':
> > nestedinlinealways.adb:3:14: error: subprogram 'nestedinlinealways.ni'
> >                                     not marked Inline_Always
> > nestedinlinealways.adb:11:4: error: parent subprogram cannot be inlined
> 
> At first, I got them wrong that the cause is at "NI".
> Next, it took time for me to understand which the "parent" is indicating.

Yes, I got caught too, something doesn't work as expected here.


More information about the Gcc-bugs mailing list