public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/31630]  New: ICE on nasty derived types code
@ 2007-04-18 21:29 fxcoudert at gcc dot gnu dot org
  2007-04-18 21:40 ` [Bug fortran/31630] [4.3 regression] " fxcoudert at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-04-18 21:29 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3146 bytes --]

The following code (original code courtesy of Mike Zingale, reduced by yours
truly) gives an ICE with current mainline:

module box_module
  type box
    integer :: m = 0
  end type box
end module box_module

module sort_box_module
contains

  subroutine heapsort_box(cmp)
    interface
       subroutine cmp(a)
         use box_module
         type(box) :: a
       end subroutine cmp
    end interface
    optional :: cmp
  end subroutine heapsort_box

end module sort_box_module


module boxarray_module
  use box_module
  implicit none

  type boxarray
    type(box), allocatable :: bxs(:)
  end type boxarray
contains

  subroutine boxarray_build_l(ba)
    type(boxarray) :: ba
    allocate(ba%bxs(1))
  end subroutine boxarray_build_l

  subroutine boxarray_sort()
    use sort_box_module
    call heapsort_box
  end subroutine boxarray_sort

end module boxarray_module

The ICE is:
boxarray.f90: In function ‘boxarray_build_l’:
boxarray.f90:34: internal compiler error: in fold_convert, at fold-const.c:2330

And its backtrace is:
Breakpoint 1, fold_convert (type=0xb7c2dbd0, arg=0xb7c2f33c)
    at ../../../trunk/gcc/fold-const.c:2330
2330          gcc_unreachable ();
(gdb) where
#0  fold_convert (type=0xb7c2dbd0, arg=0xb7c2f33c)
    at ../../../trunk/gcc/fold-const.c:2330
#1  0x080c8e25 in gfc_trans_scalar_assign (lse=0xbfb26f64, rse=0xbfb26f3c, ts=
      {type = BT_DERIVED, kind = 0, derived = 0x88b79d0, cl = 0x0}, 
    l_is_temp=1 '\001', r_is_var=0 '\0')
    at ../../../trunk/gcc/fortran/trans-expr.c:3438
#2  0x080cda79 in gfc_trans_assignment_1 (expr1=0x88ce5d0, expr2=0x88cf018, 
    init_flag=1 '\001') at ../../../trunk/gcc/fortran/trans-expr.c:3833
#3  0x080cdd45 in gfc_trans_assignment (expr1=0x88ce5d0, expr2=0x88cf018, 
    init_flag=96 '`') at ../../../trunk/gcc/fortran/trans-expr.c:3973
#4  0x080ce911 in gfc_trans_init_assign (code=0x88cead8)
    at ../../../trunk/gcc/fortran/trans-expr.c:3979
#5  0x080b0226 in gfc_trans_code (code=0x88cead8)
    at ../../../trunk/gcc/fortran/trans.c:485
#6  0x080c6045 in gfc_generate_function_code (ns=0x88d0420)
    at ../../../trunk/gcc/fortran/trans-decl.c:3217
#7  0x080af648 in gfc_generate_module_code (ns=0x887d7a0)
    at ../../../trunk/gcc/fortran/trans.c:693
#8  0x0808b9e5 in gfc_parse_file () at ../../../trunk/gcc/fortran/parse.c:3256
#9  0x080ab10d in gfc_be_parse_file (set_yydebug=0)
    at ../../../trunk/gcc/fortran/f95-lang.c:305
#10 0x082f4db2 in toplev_main (argc=13, argv=0xbfb27284)
    at ../../../trunk/gcc/toplev.c:1050
#11 0x080ecf3f in main (argc=15, argv=0x0) at ../../../trunk/gcc/main.c:35


I couldn't reduce it further, I think the ICE needs the optional argument to
heapsort_box and the default initialization in type box.


-- 
           Summary: ICE on nasty derived types code
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fxcoudert at gcc dot gnu dot org


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


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

end of thread, other threads:[~2007-05-08 14:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-18 21:29 [Bug fortran/31630] New: ICE on nasty derived types code fxcoudert at gcc dot gnu dot org
2007-04-18 21:40 ` [Bug fortran/31630] [4.3 regression] " fxcoudert at gcc dot gnu dot org
2007-04-19  5:33 ` pault at gcc dot gnu dot org
2007-04-23 15:14 ` pault at gcc dot gnu dot org
2007-04-23 16:52 ` pault at gcc dot gnu dot org
2007-05-03 17:37 ` patchapp at dberlin dot org
2007-05-08 14:41 ` pault 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).