[patch, fortran][4.4 Regression] Incorrect array value returned - 4.3 ABI Broken

Janne Blomqvist blomqvist.janne@gmail.com
Thu Sep 25 18:02:00 GMT 2008


jvdelisle@verizon.net wrote:
> Hi all,
> 
> The attached patch takes care of problems with my previous patch already
> committed.  That patch broke ABI as well.  With the example of 
> namelist_14.f90
> in the testsuite I was able to realize the real problem.
> 
> This patch reverts many of the changes in the previous and moves 
> delim_status,
> decimal_status, and pad_status into the gfc_unit structure.  This is safe
> because this entire structure is allocated and initialized by the run 
> time library.
> 
> I also eliminated the IOPARM_dt_f2003 flag bit.  This is not needed 
> because the
> F2003 features are already flagged individually by bits in 
> st_parameter_common.
> The 4.3 compiler never sets those bits, so the 4.4 run time will never 
> access
> those locations when called by a 4.3 executable and so will not 
> overwrite areas
> possibly used by 4.3.
> 
> Also, with Thomas example:
> 
> $ cat main.f90
> program main
>    open(20,form="formatted",decimal="comma")
>    write(20,fmt="(G12.5)") 1.3
>    call sub(20.)
>    write(20,fmt="(G12.5)") 1.6
> end program main[jerry@lenova pr37498]$ cat sub.f90
> subroutine sub(r)
>    write (20,fmt='(G12.5)')  r
> end
> $ ./a.out
> $ cat fort.20
>    1,3000
>    20,000
>    1,6000
> 
> The "feature" is now correct. The "unit" remembers its status. The patch 
> does
> not revert all of the previous patch. Regression tested on x86-64.
> 
> OK to commit?

Ok, looks good. Thanks for fixing these important bugs before getting 
4.4 out of the door; this will save distributors a lot of headache.

Have you tried copying the 4.4 libgfortran over the 4.3 one and running 
the 4.3 testsuite yet? I looked at ABI testing quite a while ago and I 
came to the conclusion that while the above copying approach is a bit 
kludgy it's the only one that works; IIRC the testsuite uses some rpath 
trickery so you can't use use LD_LIBRARY_PATH to pick another library.

-- 
Janne Blomqvist



More information about the Gcc-patches mailing list