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]

[Ada] Read references in ali files for out-mode parameters


The frontend was unconditionally generating a read reference for OUT
parameters. After this patch the compiler generates the read reference
only for those cases specified by RM 6.4.1(12).

package Pkg is
  procedure Write (I : out Integer);
  procedure Update (I : in out Integer);
end Pkg;

package body Pkg is
   procedure Write (I : out Integer) is
      pragma Unreferenced (I);
   begin
      null;
   end Write;

   procedure Update (I : in out Integer) is
      pragma Unreferenced (I);
   begin
      null;
   end Update;
end Pkg;

with Pkg;
procedure TEST is
 J : Integer := 0;
begin
  Pkg.Write(J);  -- out
  Pkg.Update(J); -- in out
end;

Command:
  gcc -c test.adb
  grep -i ^3i2 test.ali
Output:
  3i2 J{integer} 5m13 6m14 6r14

Tested on x86_64-pc-linux-gnu, committed on trunk

2013-02-06  Javier Miranda  <miranda@adacore.com>

	* sem_res.adb (Resolve_Actuals): Generate a read
	reference for out-mode parameters in the cases specified by
	RM 6.4.1(12).

Attachment: difs
Description: Text document


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