https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82376

            Bug ID: 82376
           Summary: Duplicate function call using -fcheck=pointer
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jrfsousa at hotmail dot com
  Target Milestone: ---

Created attachment 42268
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42268&action=edit
Code showing the bug

Allocating procedure gets called twice (and leaks) using -fcheck=pointer

$ gfortran -cpp ./bug.f90
$ ./a.out 
 ****** typea_new
   3.14000010    
$ gfortran -DNOBUG -cpp -fcheck=pointer ./bug.f90
$ ./a.out 
 ****** typea_new
   3.14000010    
$ gfortran -cpp -fcheck=pointer ./bug.f90
$ ./a.out 
 ****** typea_new
 ****** typea_new
   3.14000010    

$ gfortran --version
GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.

$ gfortran --version
GNU Fortran (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.

Best regards,
José Rui

Reply via email to