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: [Ada] Macro-ize a couple of wrappers


On Fri, 2008-04-18 at 14:34 +0200, Eric Botcazou wrote:
> > I never checked code generated by GCC on such case but I was expecting the
> > transformation to be done :).
> 
> Not across units, which is the problem here.

Interestingly:

-- p.ads
package P is
   function F (A, B, C : Integer) return Integer;
   Pragma Inline (F);
end P;
-- p.adb
package body P is
   function External (A, B : Integer) return Integer;
   pragma Import (Ada, External);

   function F (A, B, C : Integer) return Integer is
   begin
      return External (C, A);
   end F;

end P;
-- q.adb
with P;
procedure Q is
   R : Integer;
begin
   R := P.F (1, 2, 3);
end Q;
-- end source

gcc -S -g -O1 -gnatn q.adb

with 4.3.0 generates for the P.F call:

        movl    $1, %esi
        movl    $3, %edi
        call    external

Laurent



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