This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: [Patch, Fortran] Fix OPTIONAL, esp. with polymorphism


Hi Tobias,

I did not yet appied you latest patch to gfortran, but I ran the new tests
with gfortran patched with the previous patch and both pass (manual
testing without option, but -fcoarray=single). Note that for
class_optional_1.f90, valgrind --leak-check=full gives

==45665== 4 bytes in 1 blocks are definitely lost in loss record 1 of 5
==45665==    at 0x100014679: malloc (vg_replace_malloc.c:266)
==45665==    by 0x1000023A7: suba2.1920 (class_optional_1_orig_2.f90:120)
==45665==    by 0x100000F49: MAIN__ (class_optional_1_orig_2.f90:32)
==45665==    by 0x100002A3A: main (class_optional_1_orig_2.f90:77)
==45665== 
==45665== 4 bytes in 1 blocks are definitely lost in loss record 2 of 5
==45665==    at 0x100014679: malloc (vg_replace_malloc.c:266)
==45665==    by 0x100001E79: subp2.1897 (class_optional_1_orig_2.f90:152)
==45665==    by 0x10000132D: MAIN__ (class_optional_1_orig_2.f90:51)
==45665==    by 0x100002A3A: main (class_optional_1_orig_2.f90:77)
==45665== 
==45665== 4 bytes in 1 blocks are definitely lost in loss record 3 of 5
==45665==    at 0x100014679: malloc (vg_replace_malloc.c:266)
==45665==    by 0x1000025D8: subac.1929 (class_optional_1_orig_2.f90:104)
==45665==    by 0x1000015F6: MAIN__ (class_optional_1_orig_2.f90:61)
==45665==    by 0x100002A3A: main (class_optional_1_orig_2.f90:77)
==45665== 
==45665== 4 bytes in 1 blocks are definitely lost in loss record 4 of 5
==45665==    at 0x100014679: malloc (vg_replace_malloc.c:266)
==45665==    by 0x1000028A8: suba2c.1949 (class_optional_1_orig_2.f90:88)
==45665==    by 0x100001878: MAIN__ (class_optional_1_orig_2.f90:70)
==45665==    by 0x100002A3A: main (class_optional_1_orig_2.f90:77)

I dont really understand why this test was failing when included in
class_optional_2.f90. The only explanation I have is that it was run
after call s2elem(x) and call s2elem(y), that is no longer run:

635,636c794,795
< !   call s2elem(x) ! FIXME: Conditional jump or move depends on uninitialised value
< !   call s2elem(y) ! FIXME: Conditional jump or move depends on uninitialised value
---
>    call s2elem(x)
>    call s2elem(y)

These calls may have corrupted the memory(?).

Thanks for your work on the problem,

Dominique


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