[Patch, Fortran] 0/3 (PR90076) Setting _vptr correctly.

2024-06-11 Thread Andre Vehreschild
Hi GFortraneers, I like to present a small series of patches. While working of PR90076 and figuring how to best set the _vptr of class types, I discovered several ways of doing this in slightly different ways which are more or less complete (mostly rather less). I therefore decided to fix not only

[Patch, Fortran] 2/3 Refactor locations where _vptr is (re)set.

2024-06-11 Thread Andre Vehreschild
Hi all, this patch refactors most of the locations where the _vptr of a class data type is reset. The code was inconsistent in most of the locations. The goal of using only one routine for setting the _vptr is to be able to later modify it more easily. The ultimate goal being that every time one

[Patch, Fortran, 90076] 1/3 Fix Polymorphic Allocate on Assignment Memory Leak

2024-06-11 Thread Andre Vehreschild
Hi all, the attached patch fix the last case in the bug report. The inital example code is already fixed by the combination of PR90068 and PR90072. The issue was the _vptr was not (re)set correctly, like in the __vtab_...-structure was not created. This made the compiler ICE. Regtests fine on x8

[Patch, Fortran] 3/3 RFC: Introduce gfc_class_set_vptr.

2024-06-11 Thread Andre Vehreschild
Hi all, although this mail has a patch attached, it is rather a request for comment. The attached patch introduces `gfc_class_set_vptr()` for consistently assigning the _vptr of a class data type. I figured that gfortran does these assignments in various locations and does them differently everywh

[Patch, Fortran, 96418] Fix Test coarray_alloc_comp_4.f08 ICEs

2024-06-11 Thread Andre Vehreschild
Hi all, attached patch has already been present in 2020, but lost my attention. It fixes an ICE in the testsuite. The old mails description is: attached patch fixes PR96418 where the code in the testsuite when compiled with -fcoarray=single lead to an ICE. The reason was that the coarray object