[Bug fortran/56293] New: I/O: Segfault in write_float when trying to print a not-word-aligned REAL(16) / -fno-align-commons

burnus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 12 09:51:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56293

             Bug #: 56293
           Summary: I/O: Segfault in write_float when trying to print a
                    not-word-aligned REAL(16) /  -fno-align-commons
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
                CC: jb@gcc.gnu.org, jvdelisle@gcc.gnu.org


Reported by Maciej Skrzypek at
http://gcc.gnu.org/ml/fortran/2013-02/msg00058.html

In the following code, "p" is not aligned; using it fails in GCC 4.8 with a
segfault in

#0  0x00007ffff7ba5e16 in write_float (dtp=dtp@entry=0x7fffffffde40,
f=f@entry=0x7fffffffdd70, source=source@entry=0x601084 <sss_+4> "",
len=len@entry=16, 
    comp_d=comp_d@entry=1) at libgfortran/io/write_float.def:1259
#1  0x00007ffff7ba8365 in _gfortrani_write_real (dtp=dtp@entry=0x7fffffffde40,
source=source@entry=0x601084 <sss_+4> "", length=length@entry=16)
    at libgfortran/io/write.c:1470
#2  0x00007ffff7ba8dcf in list_formatted_write_scalar (size=16, kind=16,
p=0x601084 <sss_+4>, type=BT_REAL, dtp=0x7fffffffde40) at
libgfortran/io/write.c:1571
#3  _gfortrani_list_formatted_write (dtp=0x7fffffffde40, type=BT_REAL,
p=<optimized out>, kind=16, size=16, nelems=1) at libgfortran/io/write.c:1599



Compile with:  -fno-align-commons

      program main
      real(16) p
      integer i
      common/sss/ i, p
      print*, p
      end



More information about the Gcc-bugs mailing list