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] fix issues in expand_entity_reference


Tested on i686-linux, committed on trunk.

This patch corrects two problems in Expand_Entity_Reference that
intefered with proper Current_Value processing for formals. First
there was a test earlier in the routine, resulting in a possible
call to Expand_Formal, that meant formals never even got to the
test that tests for Current_Value presence. Second, the test did
not include the case of IN parameters, which can have conditional
Current_Value entries.

The following test program:

procedure k3 (m : Integer; n : in out Integer) is
begin
    if M = 3 then
       N := M;
    end if;
end k3;

compiled with -gnatG generates:

Source recreated from tree for k3 (body)
----------------------------------------


procedure k3 (m : integer; n : in out integer) is
begin
   if m = 3 then
      n := 3;
   end if;
   return;
end k3;

(before the reference to M was not replaced by 3)

2006-10-31  Robert Dewar  <dewar@adacore.com>

	* exp_ch2.adb: Change Is_Lvalue to May_Be_Lvalue
	(Expand_Entity_Reference): Correct error of not handling subprogram
	formals in current_value processing.

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]