Commit 1d60cc55 by Eric Botcazou Committed by Eric Botcazou

tree-sra.c (build_ref_for_offset): Strip useless type conversions from the…

tree-sra.c (build_ref_for_offset): Strip useless type conversions from the address built for a reference with...

	* tree-sra.c (build_ref_for_offset): Strip useless type conversions
	from the address built for a reference with variable offset.

From-SVN: r171393
parent c78dd519
2011-03-24 Eric Botcazou <ebotcazou@adacore.com>
* tree-sra.c (build_ref_for_offset): Strip useless type conversions
from the address built for a reference with variable offset.
2011-03-24 Uros Bizjak <ubizjak@gmail.com>
PR target/48237
......
2011-03-24 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/array15.ad[sb]: New test.
2011-03-24 Uros Bizjak <ubizjak@gmail.com>
PR target/48237
......
-- { dg-do compile }
-- { dg-options "-O -gnatws" }
package body Array15 is
type Arr is array (Natural range <>) of Integer;
Table : Arr (1 .. 4);
N : Natural := 1;
procedure Zero is
begin
N := 0;
end;
function F (I : Integer) return Integer is
A1 : Arr := (1 => I);
A2 : Arr := Table (1 .. N) & A1;
begin
return A2 (I);
end;
end Array15;
package Array15 is
function F (I : Integer) return Integer;
end Array15;
......@@ -1376,6 +1376,7 @@ build_ref_for_offset (location_t loc, tree base, HOST_WIDE_INT offset,
add_referenced_var (tmp);
tmp = make_ssa_name (tmp, NULL);
addr = build_fold_addr_expr (unshare_expr (prev_base));
STRIP_USELESS_TYPE_CONVERSION (addr);
stmt = gimple_build_assign (tmp, addr);
gimple_set_location (stmt, loc);
SSA_NAME_DEF_STMT (tmp) = stmt;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment