mirror of
https://gcc.gnu.org/git/gcc.git
synced 2026-02-22 03:46:53 -05:00
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: r122096
This commit is contained in:
committed by
Eric Botcazou
parent
152402ac8c
commit
737261b096
@@ -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 Ira Rosen <irar@il.ibm.com>
|
||||
|
||||
* tree-ssa-alias.c (may_aliases_intersect): New function.
|
||||
|
||||
@@ -1480,10 +1480,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>
|
||||
|
||||
* lib/gnat.exp (gnat_target_compile): Pass -f to the driver.
|
||||
|
||||
9
gcc/testsuite/gnat.dg/tail_call.adb
Normal file
9
gcc/testsuite/gnat.dg/tail_call.adb
Normal file
@@ -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;
|
||||
35
gcc/testsuite/gnat.dg/tail_call_p.adb
Normal file
35
gcc/testsuite/gnat.dg/tail_call_p.adb
Normal file
@@ -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;
|
||||
13
gcc/testsuite/gnat.dg/tail_call_p.ads
Normal file
13
gcc/testsuite/gnat.dg/tail_call_p.ads
Normal file
@@ -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;
|
||||
Reference in New Issue
Block a user