This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/71412] iso_c_bindings and optimization interaction bug
- From: "relliott at umn dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 07 Jun 2016 02:40:18 +0000
- Subject: [Bug fortran/71412] iso_c_bindings and optimization interaction bug
- Auto-submitted: auto-generated
- References: <bug-71412-4 at http dot gcc dot gnu dot org/bugzilla/>
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