This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/69298] Array finalisers seem to be given the wrong array when the array is a member variable.
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 25 Jan 2016 11:10:35 +0000
- Subject: [Bug fortran/69298] Array finalisers seem to be given the wrong array when the array is a member variable.
- Auto-submitted: auto-generated
- References: <bug-69298-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69298
--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Created attachment 37448 [details]
> Self-contained variant
With n=3, the output of the attached test is
Initialising stuff_type 4
Finalising stuff_type 0
...
---
Initialising test_type
Initialising stuff_type 4
Finalising stuff_type 0
Copy initialiser 4 4
Initialising stuff_type 1
Finalising stuff_type 0
Copy initialiser 1 1
Initialising stuff_type 2
Finalising stuff_type 0
Copy initialiser 2 2
Initialising stuff_type 3
Finalising stuff_type 0
Copy initialiser 3 3
Finalising stuff_type 4
Copy initialiser 4 4
thing 10
Finalising stuff_type 4
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
Changing 'n' to 2 or 4, gives respectively
...
---
Initialising test_type
Initialising stuff_type 4
Finalising stuff_type 1342972320
Copy initialiser 4 4
Initialising stuff_type 1
Finalising stuff_type 32767
Copy initialiser 1 1
Initialising stuff_type 2
Finalising stuff_type 263453344
Copy initialiser 2 2
Finalising stuff_type 4
Copy initialiser 4 4
thing 7
Finalising stuff_type 4
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
and
...
Initialising test_type
Initialising stuff_type 4
Finalising stuff_type 107478528
Copy initialiser 4 4
Initialising stuff_type 1
Finalising stuff_type 1
Copy initialiser 1 1
Initialising stuff_type 2
Finalising stuff_type 5120
Copy initialiser 2 2
Initialising stuff_type 3
Finalising stuff_type 0
Copy initialiser 3 3
Initialising stuff_type 4
Finalising stuff_type 1501114256
Copy initialiser 4 4
Finalising stuff_type 4
Copy initialiser 4 4
thing 14
Finalising stuff_type 4
where the nonzero values changed between different runs.