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

jvdelisle@verizon.net jvdelisle@verizon.net
Thu Sep 25 06:48:00 GMT 2008


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?

Jerry

2008-09-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org

	PR fortran/37498
	* trans-io.c (build_dt): Revert previous patch..
	* ioparm.def: Delete IOPARM_dt_f2003.

2008-09-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org

	PR libfortran/37498
	* list_read.c (eat_separator): Revert previous patch and move
	delim_status, decimal_status, and pad_status to gfc_unit.
	(parse_real): Ditto. (read_real): Ditto.
	* read.c (read_a): Likewise. (read_a_char4): Likewise.
	(read_f): Likewise.
	* io.h (unit_sign_s): Move delim_status, decimal_status, and pad_status
	to gfc_unit.
	* transfer.c (read_sf): Ditto. (read_block_form): Ditto.
	(formatted_transfer_scalar): Ditto. (data_transfer_init): Ditto.
	* write.c (write_default_char4): Ditto. (write_utf8_char4): Ditto.
	(write_character): Ditto. (write_real_g0): Ditto.
	(list_formatted_write_scalar): Ditto. (nml_write_obj): Ditto.
	(namelist_write): Ditto.
	* write_float.def (calculate_sign): Ditto. (output_float): Ditto.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr37498-e.diff
Type: application/octet-stream
Size: 19116 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080925/d33df850/attachment.obj>


More information about the Gcc-patches mailing list