tree-sra.c (decide_block_copy): Decide if there are groups.

* tree-sra.c (decide_block_copy): Decide if there are groups.

From-SVN: r128602
This commit is contained in:
Eric Botcazou 2007-09-19 15:23:01 +00:00 committed by Eric Botcazou
parent e59d83aa39
commit 34c0750b24
5 changed files with 37 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2007-09-19 Eric Botcazou <ebotcazou@adacore.com>
* tree-sra.c (decide_block_copy): Decide if there are groups.
2007-09-19 Roman Zippel <zippel@linux-m68k.org>
* config/m68k/m68k.c (output_move_himode): Remove jump table

View File

@ -1,3 +1,7 @@
2007-09-19 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/slice2.ad[sb]: New testcase.
2007-09-19 Nick Clifton <nickc@redhat.com>
* gcc.dg/cpp/assert4.c: Fix expected h8300 preprocessor define.

View File

@ -0,0 +1,13 @@
-- { dg-do compile }
-- { dg-options "-O" }
package body Slice2 is
function F (I : R1) return R2 is
Val : R2;
begin
Val.Text (1 .. 8) := I.Text (1 .. 8);
return Val;
end F;
end Slice2;

View File

@ -0,0 +1,14 @@
package Slice2 is
type R1 is record
Text : String (1 .. 30);
end record;
type R2 is record
Text : String (1 .. 8);
B : Boolean := True;
end record;
function F (I : R1) return R2;
end Slice2;

View File

@ -1491,8 +1491,8 @@ decide_block_copy (struct sra_elt *elt)
return false;
}
/* Don't decide if we've no uses. */
if (elt->n_uses == 0 && elt->n_copies == 0)
/* Don't decide if we've no uses and no groups. */
if (elt->n_uses == 0 && elt->n_copies == 0 && elt->groups == NULL)
;
else if (!elt->is_scalar)