| 1 |
-- { dg-do compile } |
| 2 |
-- { dg-options "-O2" } |
| 3 |
|
| 4 |
-- rpo fre3 used to loop indefinitely replacing _2 with _8 and back, |
| 5 |
-- given MEM[(struct test__e &)_2][0]{lb: _7 sz: 16}._tag = A23s_29; |
| 6 |
-- and an earlier _8 = &*_2[0]{lb: _7 sz: 16}. |
| 7 |
|
| 8 |
procedure Opt83 is |
| 9 |
|
| 10 |
type E is tagged record |
| 11 |
I : Natural := 0; |
| 12 |
end record; |
| 13 |
|
| 14 |
type A is array (Natural range <>) of aliased E; |
| 15 |
|
| 16 |
F : E; |
| 17 |
|
| 18 |
R : access A; |
| 19 |
|
| 20 |
procedure N is |
| 21 |
begin |
| 22 |
if R = null then |
| 23 |
R := new A (0 .. 4); |
| 24 |
end if; |
| 25 |
end N; |
| 26 |
|
| 27 |
begin |
| 28 |
|
| 29 |
N; |
| 30 |
|
| 31 |
R (0) := F; |
| 32 |
|
| 33 |
end Opt83; |