[Bug fortran/82896] New: probably pointer assignement bug in gfortran compiler version 7.2.0
jeangual at yahoo dot fr
gcc-bugzilla@gcc.gnu.org
Wed Nov 8 09:07:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82896
Bug ID: 82896
Summary: probably pointer assignement bug in gfortran compiler
version 7.2.0
Product: gcc
Version: 7.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: jeangual at yahoo dot fr
Target Milestone: ---
Created attachment 42560
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42560&action=edit
source fortran code
The small attached source (100 lines) finish with segmental fault with the
latest Mingw release (gcc version 7.2.0 (Rev1, Built by MSYS2 project) and did
works very well with the previous version (gcc version 6.1.0 (x86_64-posix-seh,
Built by MinGW-W64 project) .
I send this bug to Mingw org. and this answer is :
This looks like a code generation issue in gcc itself. Looking at the assembly
that was generated, it appears the vtbl function pointers aren't being set
properly for the extension class. Please report this to the gcc bugzilla at
https://gcc.gnu.org/bugzilla/, as the code generated is invalid on a linux
machine as well (verified with gcc version 7.2.1 20170915 (Red Hat 7.2.1-2)
(GCC)
Bug description :
I reduced the code source to the minimal size and when we reduce more the code
turn normaly. we use in this code the latets oriented object specifications
proposed with the 2003 fortran release.
I have a big load experience of Fortran bugs and i am sure that is a bug
compiler because in the code source there is not any array, ni parameter
mismath ni other instruction that usely causes bugs. Moreover ther are only
five instructions between the start program and the segmental fault :
allocate (mate)
Call mate%Creer_situation_acier(1)
allocate (pt_situation)
pt_situation%m_pt_materiau => this
Call pt_situation%Set_Type_Situation_projet (type_situation)
The main instruction in cause in the bug is the pointer assignement in the
routine Creer_situation_acier :
pt_situation%m_pt_materiau => this
and the segmentaion fault appears with the folower instruction :
Call pt_situation%Set_Type_Situation_projet (type_situation)
The compilation instruction is :
gfortran *.f90
the bug doesnot depends on the compilation options like optimisation level and
degug level.
Thanks for your help.
More information about the Gcc-bugs
mailing list