RFC: PR37472 bad output on default-format write of double in common block with -m64

Jerry DeLisle jvdelisle@verizon.net
Mon Dec 22 06:27:00 GMT 2008


Hi all,

This is an interesting bug.  On x86-64 I can see a shift of the placement of the 
decimal point in formatted output of kind=8 and kind=10 reals between using -m64 
and -m32.  The incorrect output appears with -m32.

The attached patch appears to fix this.  The only part of the patch that seems 
essential is changing the type of temp to GFC_REAL_4 rather than have the type 
match the type of the variable being output.  GFC_REAL_4 is C type float.

I have tried several variations of the macros, passing in the L descriptor and 
do not see it makes any difference.  I am open to suggestions here or any 
further insight.

The patch is fully regression tested at -m32 and -m64 so I think it is safe.

Shall I commit?

Regards,

Jerry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr37472.diff
Type: text/x-diff
Size: 1210 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20081222/289e00de/attachment.bin>


More information about the Fortran mailing list