This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/71412] iso_c_bindings and optimization interaction bug


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

--- Comment #9 from relliott at umn dot edu ---
Hello,

I still believe there is a bug associated with the iso_c_bindings and c_loc() 
support.  In the attached, I've created an example program that shows that 
ALLOCATABLE local variables are deallocated at the end of a routine (noleak), 
but pointer variables are not (leak).

Then, I've created a program without using iso_c_bindings that gives the same 
result for -O0 and -O3 (pointer_fortran) and a program that uses iso_c_bindings 
to do the same thing that gives different results for -O0 and -O3 
(pointer_cstyle).

Use the 'runme.sh' script to illustrate the following behavior:


$ ./runme.sh
----- running 'noleak'
----- running 'leak'
./runme.sh: line 15:  3233 Killed                  ./leak
----- running O0 version of 'pointer_fortran'
  F
  T
    3.14000010
----- running O3 version of 'pointer_fortran'
  F
  T
    3.14000010
----- running O0 version of 'pointer_cstyle'
  F F
  T F
  T T
    3.14000010
----- running O3 version of 'pointer_cstyle'
  F F
  T F
  T T
    0.00000000



Thanks,

Ryan

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]