[Bug fortran/71412] iso_c_bindings and optimization interaction bug
relliott at umn dot edu
gcc-bugzilla@gcc.gnu.org
Tue Jun 7 02:40:00 GMT 2016
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
More information about the Gcc-bugs
mailing list