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

* [Bug fortran/31630] [4.3 regression] ICE on nasty derived types code
  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 ` fxcoudert at gcc dot gnu dot org
  2007-04-19  5:33 ` pault at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-04-18 21:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from fxcoudert at gcc dot gnu dot org  2007-04-18 22:40 -------
It's a 4.3 regression, because it compiles with 4.2 (although I haven't looked
at the generated code).


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org, zingale at gmail dot
                   |                            |com
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to fail|                            |4.3.0
      Known to work|                            |4.2.0
   Last reconfirmed|0000-00-00 00:00:00         |2007-04-18 22:40:32
               date|                            |
            Summary|ICE on nasty derived types  |[4.3 regression] ICE on
                   |code                        |nasty derived types code


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


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

* [Bug fortran/31630] [4.3 regression] ICE on nasty derived types code
  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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-04-19  5:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pault at gcc dot gnu dot org  2007-04-19 06:32 -------
(In reply to comment #1)

Move use sort_box_module up to module level and it compiles fine.  This is yet
another derived type association regression that I would swear is identical to
one of the testcases:)

It's mine.

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pault at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-04-18 22:40:32         |2007-04-19 06:32:50
               date|                            |


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


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

* [Bug fortran/31630] [4.3 regression] ICE on nasty derived types code
  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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-04-23 15:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pault at gcc dot gnu dot org  2007-04-23 16:14 -------
Subject: Bug 31630

Author: pault
Date: Mon Apr 23 16:13:48 2007
New Revision: 124069

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124069
Log:
2007-04-23  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/31630
        * resolve.c (resolve_symbol): Allow resolution of formal
        namespaces nested within formal namespaces coming from modules.

        PR fortran/31620
        * trans-expr.c (gfc_trans_assignment): Make the call to
        gfc_trans_zero_assign conditional on the lhs array ref being
        the only reference.

2007-04-23  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/31630
        * gfortran.dg/used_types_17.f90: New test.

        PR fortran/31620
        * gfortran.dg/zero_array_components_1.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/used_types_17.f90
    trunk/gcc/testsuite/gfortran.dg/zero_array_components_1.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/31630] [4.3 regression] ICE on nasty derived types code
  2007-04-18 21:29 [Bug fortran/31630] New: ICE on nasty derived types code fxcoudert at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-04-23 16:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pault at gcc dot gnu dot org  2007-04-23 17:52 -------
Fixed on trunk

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug fortran/31630] [4.3 regression] ICE on nasty derived types code
  2007-04-18 21:29 [Bug fortran/31630] New: ICE on nasty derived types code fxcoudert at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: patchapp at dberlin dot org @ 2007-05-03 17:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from patchapp at dberlin dot org  2007-05-03 18:37 -------
Subject: Bug number PR31630

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-05/msg00116.html


-- 


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


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

* [Bug fortran/31630] [4.3 regression] ICE on nasty derived types code
  2007-04-18 21:29 [Bug fortran/31630] New: ICE on nasty derived types code fxcoudert at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-05-03 17:37 ` patchapp at dberlin dot org
@ 2007-05-08 14:41 ` pault at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-05-08 14:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pault at gcc dot gnu dot org  2007-05-08 15:41 -------
Subject: Bug 31630

Author: pault
Date: Tue May  8 14:40:58 2007
New Revision: 124550

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124550
Log:
2007-05-08  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/31630
        * resolve.c (resolve_symbol): Remove the flagging mechanism from the
        formal namespace resolution and instead check that the formal
        namespace is not the current namespace.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c


-- 


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).