> And you did not add that test case, why?  Now there is a possible fix
> for a pretty ugly regression, and we can only *guess* why something is
> done the way it is???

I found the test case.  As I suspected, it was on Sparc (the test case failed
for a different reason on Mips) and was indeed a case where there were two
function calls in the same parameter list of an outer call (though not the
same function).  It was an Ada test case, which we had no place to put
back in 1999.  Here it is.  The proper output is 

a_value= 10 b_value= 20

but with -O1 on Sparc, it gave

a_value= 20 b_value= 20

(It worked with -O2.)

with Ada.Text_Io;

procedure Test_Func is
   type A_Int is new Integer range 1..10;
   type B_Int is new Integer range 11..20;
   type A_Array is array(1..5) of A_Int;
   type B_Array is array(1..5) of B_Int;

   procedure  Print_Values (A_Value  : in A_Int;
                            B_Value : in B_Int)  is
   begin
      Ada.Text_Io.Put_Line("a_value="  & Integer'Image(Integer(A_Value)) &
                           " b_value=" & Integer'Image(Integer(B_Value)));
   end Print_Values;

   function Get_A return A_Array is
      A : A_Array := (others => 10);
   begin
      return A;
   end Get_A;

   function Get_B return B_Array is
      B : B_Array := (others => 20);
   begin
      return B;
   end Get_B;

   J : Natural := 3;
begin

   Print_Values
     (A_Value =>Get_A(J), B_Value =>Get_B(J));
end Test_Func;

Reply via email to