public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [Ada] How suppress code generation of inlined operations
@ 2003-01-13 18:07 Robert Dewar
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Dewar @ 2003-01-13 18:07 UTC (permalink / raw)
  To: gcc, rolf.ebert.gcc

There is no way to ensure suppression of this code.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Ada] How suppress code generation of inlined operations
       [not found] <19200.1042214372@www5.gmx.net>
@ 2003-01-13 14:18 ` rolf.ebert.gcc
  0 siblings, 0 replies; 2+ messages in thread
From: rolf.ebert.gcc @ 2003-01-13 14:18 UTC (permalink / raw)
  To: gcc

My package spec declares an inlined operation:

package AVR.IO is
   pragma Pure(AVR.IO);

   -- type IO_Address is new Unsigned_8 range 0 .. 63; is defined in 
   -- the AVR package spec.

   -- read value from I/O register IO_Reg
   function Get_IO(IO_Reg : IO_Address) return Unsigned_8;
   pragma Inline_Always(Get_IO);

end AVR.IO;

In the body the function is realized in assembler code:

with System.Machine_Code;      use System.Machine_Code;
package body AVR.IO is

   function Get_IO(IO_Reg : IO_Address) return Unsigned_8 is
      Value : Unsigned_8;
   begin
      pragma Warnings(Off);
      Asm("in %0,%1",
          Outputs => Unsigned_8'Asm_Output("=r", Value),
          Inputs  => IO_Address'Asm_Input("I", IO_Reg),
          Volatile => True);
      return Value;
   end Get_IO;
end AVR.IO;

This all works well and correctly for all clients of the package, i.e.
code using the Get_IO function. The Ada binding step gnatbind 
requires to compile the package itself. As the input contraint I 
(constant in the range 0 .. 63) asks for a compile time constant 
the compiler cannot generate code and issues an error.

The Get_IO function is inlined anyway.  There is no use to generate code
for a callable function. How can one inhibit the code generation for a
specific function?

I tried  the pragma Eliminate on the function. That, however, causes error
messages at the locations, where Get_IO is used.

    Rolf

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-01-13 15:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-13 18:07 [Ada] How suppress code generation of inlined operations Robert Dewar
     [not found] <19200.1042214372@www5.gmx.net>
2003-01-13 14:18 ` rolf.ebert.gcc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).