This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/33554] Seg.fault: Default initialization of derived type uses initialized values



------- Comment #2 from burnus at gcc dot gnu dot org  2007-09-25 19:16 -------
Work around:  Change the intent to INOUT in:
  subroutine construct_temp (temp)
    type (t_temp), intent(out) :: temp (:)

or - which is effectively the same - remove the default initializer:

  type t_datum
    character(len=8) :: mn = ''

>From the dump:

construct_temp (temp)
{
  int8 ubound.0;
  int8 stride.1;
  if (temp != 0)
    {
      {
        int8 D.888;
        int8 D.887;

        D.887 = offset.2;
        D.888 = ubound.0;

Question to the reader: Which value has ubound and offset in the assignment
above?


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   GCC host triplet|i686-pc-linux-gnu           |
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2007-09-25 19:16:45
               date|                            |
            Summary|Runtime segfault with nested|Seg.fault: Default
                   |derived types with -O0      |initialization of derived
                   |                            |type uses initialized values


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]