public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/30594]  New: Calling inquire (iolength) crashes with -malign-double
@ 2007-01-26  1:36 schnetter at aei dot mpg dot de
  2007-01-26  3:37 ` [Bug fortran/30594] " jvdelisle at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: schnetter at aei dot mpg dot de @ 2007-01-26  1:36 UTC (permalink / raw)
  To: gcc-bugs

With GNU Fortran 95 (GCC) 4.3.0 20070125 (experimental), the programme

      program main
      integer size
      integer*1 var
      open (10, file="conftestval", status="unknown")
      inquire (iolength=size) var
      write (10, *) size
      close (10)
      end

compiled with the options

/Users/eschnett/gcc/bin/gfortran -o conftest conftest.f -malign-double

leads to a bus error:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00002ff8
0x0025ca38 in *__gfortran_st_iolength (dtp=0xbffff0c0) at
/Users/eschnett/src/gcc/libgfortran/io/transfer.c:2630
2630        *dtp->iolength = 0;

The problem seems to be that struct st_parameter_dt changes its layout
depending on whether -malign-double is in effect or not, making the compiled
programme incompatible with the run-time library.

I see two solutions: Either this struct should be modified so that it is
independent of -malign-double, or the compiler should take special measures
when building the tree for this structure, making sure to use standard
alignments.  Since I don't know how to build trees with non-standard
alignments, I will send a patch that permutes the elements st_parameter_dt.


-- 
           Summary: Calling inquire (iolength) crashes with -malign-double
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: schnetter at aei dot mpg dot de
 GCC build triplet: i386-apple-darwin8.8.1
  GCC host triplet: i386-apple-darwin8.8.1
GCC target triplet: i386-apple-darwin8.8.1


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-01-26 18:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-26  1:36 [Bug fortran/30594] New: Calling inquire (iolength) crashes with -malign-double schnetter at aei dot mpg dot de
2007-01-26  3:37 ` [Bug fortran/30594] " jvdelisle at gcc dot gnu dot org
2007-01-26  3:53 ` pinskia at gcc dot gnu dot org
2007-01-26  3:54 ` pinskia at gcc dot gnu dot org
2007-01-26 14:36 ` schnetter at aei dot mpg dot de
2007-01-26 16:11 ` jvdelisle at gcc dot gnu dot org
2007-01-26 17:43 ` pinskia at gcc dot gnu dot org
2007-01-26 18:53 ` kargl at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).