re PR middle-end/35136 (ICE caused by address calculation with loop variable when optimization is on)

PR middle-end/35136
	* gimplify.c (force_gimple_operand_bsi): Move SSA renaming code from
	here to...
	(force_gimple_operand): ...here.

From-SVN: r132267
This commit is contained in:
Eric Botcazou 2008-02-12 20:49:21 +00:00 committed by Eric Botcazou
parent a1bd4be4e2
commit 81186f7b23
4 changed files with 49 additions and 8 deletions

View File

@ -1,3 +1,10 @@
2008-02-12 Eric Botcazou <ebotcazou@adacore.com>
PR middle-end/35136
* gimplify.c (force_gimple_operand_bsi): Move SSA renaming
code from here to...
(force_gimple_operand): ...here.
2008-02-12 Jakub Jelinek <jakub@redhat.com>
PR c++/35144

View File

@ -6629,6 +6629,14 @@ force_gimple_operand (tree expr, tree *stmts, bool simple, tree var)
pop_gimplify_context (NULL);
if (*stmts && gimple_in_ssa_p (cfun))
{
tree_stmt_iterator tsi;
for (tsi = tsi_start (*stmts); !tsi_end_p (tsi); tsi_next (&tsi))
mark_symbols_for_renaming (tsi_stmt (tsi));
}
return expr;
}
@ -6648,14 +6656,6 @@ force_gimple_operand_bsi (block_stmt_iterator *bsi, tree expr,
expr = force_gimple_operand (expr, &stmts, simple_p, var);
if (stmts)
{
if (gimple_in_ssa_p (cfun))
{
tree_stmt_iterator tsi;
for (tsi = tsi_start (stmts); !tsi_end_p (tsi); tsi_next (&tsi))
mark_symbols_for_renaming (tsi_stmt (tsi));
}
if (before)
bsi_insert_before (bsi, stmts, m);
else

View File

@ -1,3 +1,7 @@
2008-02-12 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/loop_address.adb: New test.
2008-02-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* obj-c++.dg/bitfield-1.mm: Expect failures.

View File

@ -0,0 +1,30 @@
-- { dg-do compile }
-- { dg-options "-O -gnatws" }
-- PR middle-end/35136
pragma Extend_System(AUX_DEC);
with System;
procedure Loop_Address is
function Y(E : Integer) return String is
begin
return "";
end Y;
function X(C : in System.Address) return String is
D : Integer;
for D use at C;
begin
return Y(D);
end X;
A : System.Address;
B : String := "";
begin
for I in 0..1 loop
B := X(System."+"(A, I));
end loop;
end;