tree-inline.c (copy_bb): Use GSI_CONTINUE_LINKING when inserting new statements because of the return...

* tree-inline.c (copy_bb): Use GSI_CONTINUE_LINKING when inserting new
	statements because of the return slot optimization.

From-SVN: r164622
This commit is contained in:
Eric Botcazou 2010-09-25 21:34:45 +00:00 committed by Eric Botcazou
parent de5142553a
commit cf1bcf06a1
6 changed files with 70 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2010-09-25 Eric Botcazou <ebotcazou@adacore.com>
* tree-inline.c (copy_bb): Use GSI_CONTINUE_LINKING when inserting new
statements because of the return slot optimization.
2010-09-25 Anatoly Sokolov <aesok@post.ru>
* config/avr/avr.h (CLASS_LIKELY_SPILLED_P): Remove.

View File

@ -1,3 +1,8 @@
2010-09-25 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/return2.ad[sb]: New test.
* gnat.dg/return2_pkg.ads: New helper.
2010-09-25 Daniel Kraft <d@domob.eu>
PR fortran/45776

View File

@ -0,0 +1,33 @@
-- { dg-do compile }
-- { dg-options "-O" }
with Return2_Pkg; use Return2_Pkg;
package body Return2 is
function Value_Internal (Image : String) return Result_Internal_T is
begin
return (Member => False);
end;
type Result_T is array (1 .. 2) of Result_Internal_T;
function Value (Img : String) return T is
My_F : constant String := F;
Result : Result_T;
Value : T;
begin
for I in Result'Range loop
if G (My_F, I) /= "" then
Result (I) := Value_Internal (G (My_F, I));
if Result (I).Member then
Value (Result (I).Data) := True;
else
raise Program_Error;
end if;
end if;
end loop;
return Value;
end;
end Return2;

View File

@ -0,0 +1,18 @@
package Return2 is
type Kind_T is (One, Two);
type T is array (Kind_T) of Boolean;
type Result_Internal_T (Member : Boolean := False) is record
case Member is
when True =>
Data : Kind_T := Kind_T'First;
when False =>
null;
end case;
end record;
function Value (Img : String) return T;
end Return2;

View File

@ -0,0 +1,7 @@
package Return2_Pkg is
function F return String;
function G (Line : String; Index : Positive) return String;
end Return2_Pkg;

View File

@ -1558,7 +1558,8 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
tree new_rhs;
new_rhs = force_gimple_operand_gsi (&seq_gsi,
gimple_assign_rhs1 (stmt),
true, NULL, false, GSI_NEW_STMT);
true, NULL, false,
GSI_CONTINUE_LINKING);
gimple_assign_set_rhs1 (stmt, new_rhs);
id->regimplify = false;
}