This is the mail archive of the 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: Unnecessary call to mark_temp_addr_taken in calls.c (related to pr25505)?

> 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
      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);
      return A;
   end Get_A;

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

   J : Natural := 3;

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

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