| 1 |
-- { dg-do compile } |
| 2 |
-- { dg-options "-O2 -fno-inline -fdump-tree-optimized" } |
| 3 |
-- { dg-additional-options "-cargs --param=sra-max-scalarization-size-Ospeed=32 -margs" { target aarch64-*-* hppa*-*-* powerpc*-*-* } } |
| 4 |
|
| 5 |
procedure Opt39 (I : Integer) is |
| 6 |
|
| 7 |
type Rec is record |
| 8 |
I1 : Integer; |
| 9 |
I2 : Integer; |
| 10 |
I3 : Integer; |
| 11 |
I4 : Integer; |
| 12 |
I5 : Integer; |
| 13 |
end record; |
| 14 |
|
| 15 |
procedure Set (A : access Rec; I : Integer) is |
| 16 |
Tmp : Rec := A.all; |
| 17 |
begin |
| 18 |
Tmp.I1 := I; |
| 19 |
A.all := Tmp; |
| 20 |
end; |
| 21 |
|
| 22 |
R : aliased Rec; |
| 23 |
|
| 24 |
begin |
| 25 |
Set (R'Access, I); |
| 26 |
if R.I1 /= I then |
| 27 |
raise Program_Error; |
| 28 |
end if; |
| 29 |
end; |
| 30 |
|
| 31 |
-- { dg-final { scan-tree-dump-not "MEM" "optimized" } } |
| 32 |
-- { dg-final { scan-tree-dump-not "tmp" "optimized" } } |