calls.c (mem_overlaps_already_clobbered_arg_p): Return true for arg pointer based indexed addressing.
* calls.c (mem_overlaps_already_clobbered_arg_p): Return true for arg pointer based indexed addressing. From-SVN: r122095
This commit is contained in:
parent
0028647ea7
commit
ae22dcff00
|
@ -1,3 +1,8 @@
|
|||
2007-02-18 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* calls.c (mem_overlaps_already_clobbered_arg_p): Return true
|
||||
for arg pointer based indexed addressing.
|
||||
|
||||
2007-02-18 Kazu Hirata <kazu@codesourcery.com>
|
||||
|
||||
* config/ia64/ia64.h, config/ia64/ia64.md,
|
||||
|
|
|
@ -1481,10 +1481,14 @@ mem_overlaps_already_clobbered_arg_p (rtx addr, unsigned HOST_WIDE_INT size)
|
|||
if (addr == current_function_internal_arg_pointer)
|
||||
i = 0;
|
||||
else if (GET_CODE (addr) == PLUS
|
||||
&& (XEXP (addr, 0)
|
||||
== current_function_internal_arg_pointer)
|
||||
&& XEXP (addr, 0) == current_function_internal_arg_pointer
|
||||
&& GET_CODE (XEXP (addr, 1)) == CONST_INT)
|
||||
i = INTVAL (XEXP (addr, 1));
|
||||
/* Return true for arg pointer based indexed addressing. */
|
||||
else if (GET_CODE (addr) == PLUS
|
||||
&& (XEXP (addr, 0) == current_function_internal_arg_pointer
|
||||
|| XEXP (addr, 1) == current_function_internal_arg_pointer))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2007-02-18 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* gnat.dg/tail_call_p.ads, tail_call_p.adb, tail_call.adb: New test.
|
||||
|
||||
2007-02-18 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* gnat.dg/test_prio_p.adb: Compile with -gnatws.
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
-- { dg-do run }
|
||||
-- { dg-options "-O2 -fno-unit-at-a-time" }
|
||||
|
||||
with Tail_Call_P; use Tail_Call_P;
|
||||
|
||||
procedure Tail_Call is
|
||||
begin
|
||||
Insert (My_Array, 0, 0);
|
||||
end;
|
|
@ -0,0 +1,35 @@
|
|||
package body Tail_Call_P is
|
||||
|
||||
function Start_Side (Element : T) return Index is
|
||||
begin
|
||||
if Element = 1 then
|
||||
raise Program_Error;
|
||||
end if;
|
||||
if Element = 0 then
|
||||
return Second;
|
||||
else
|
||||
return First;
|
||||
end if;
|
||||
end;
|
||||
|
||||
function Segment (Element : T) return T is
|
||||
begin
|
||||
if Element /= 0 then
|
||||
raise Program_Error;
|
||||
end if;
|
||||
return 1;
|
||||
end;
|
||||
|
||||
procedure Really_Insert (Into : T; Element : T; Value : T) is
|
||||
begin
|
||||
if Into /= 0 then
|
||||
raise Program_Error;
|
||||
end if;
|
||||
end;
|
||||
|
||||
procedure Insert (Into : A; Element : T; Value : T) is
|
||||
begin
|
||||
Really_Insert (Into (Start_Side (Element)), Segment (Element), Value);
|
||||
end Insert;
|
||||
|
||||
end Tail_Call_P;
|
|
@ -0,0 +1,13 @@
|
|||
package Tail_Call_P is
|
||||
|
||||
type T is new Natural;
|
||||
|
||||
type Index is (First, Second);
|
||||
|
||||
type A is array (Index) of T;
|
||||
|
||||
My_Array : A := (0, 0);
|
||||
|
||||
procedure Insert (Into : A; Element : T; Value : T);
|
||||
|
||||
end Tail_Call_P;
|
Loading…
Reference in New Issue