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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|I/O: Segfault in            |Segfault when trying to
                   |write_float when trying to  |access pass-by-reference
                   |print a not-word-aligned    |value of a not-word-aligned
                   |REAL(16) /                  |REAL(16) /
                   |-fno-align-commons          |-fno-align-commons

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-02-12 
12:35:19 UTC ---
Also occurs if one calls ("call foo(p)"):
      subroutine foo(x)
        real(16) :: x, y
        y = x  ! FAILS HERE
        ! print *, y
      end subroutine foo
instead of "print *, p".


The bug is probably somewhere in gcc/fortran/trans-common.c's. For instance at
build_common_decl, which uses:

      if (!com->is_bind_c)
        DECL_ALIGN (decl) = BIGGEST_ALIGNMENT;

or/and in "build_field", which has:

  known_align = (offset & -offset) * BITS_PER_UNIT;
  if (known_align == 0 || known_align > BIGGEST_ALIGNMENT)
    known_align = BIGGEST_ALIGNMENT;

  desired_align = update_alignment_for_field (rli, field, known_align);
  if (desired_align > known_align)
       (field) = 1;

or …

Reply via email to