public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/57116] New: ICE for pointer assignment inside SELECT TYPE on UP entity
@ 2013-04-29 19:53 Bader at lrz dot de
  2013-04-29 21:54 ` [Bug fortran/57116] " dominiq at lps dot ens.fr
  2013-04-30 12:13 ` [Bug fortran/57116] [OOP] ICE for pointer assignment inside SELECT TYPE janus at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: Bader at lrz dot de @ 2013-04-29 19:53 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 57116
           Summary: ICE for pointer assignment inside SELECT TYPE on UP
                    entity
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: Bader@lrz.de


Created attachment 29976
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29976
module and main program as standalone source.

The attached Fortran source produces the following error message with gfortran
4.8.0:

rtti_pointerassign_02_pos.f90: In function `extract':
rtti_pointerassign_02_pos.f90:13:0: internal compiler error: Segmentation fault
        extract => this(ic:)
 ^
0x87e07f crash_signal
        ../../gcc-4.8.0/gcc/toplev.c:332
0x5d2db2 gfc_trans_pointer_assignment(gfc_expr*, gfc_expr*)
        ../../gcc-4.8.0/gcc/fortran/trans-expr.c:6555
0x5a7896 trans_code
        ../../gcc-4.8.0/gcc/fortran/trans.c:1439
0x5f0e28 gfc_trans_block_construct(gfc_code*)
        ../../gcc-4.8.0/gcc/fortran/trans-stmt.c:1342
0x5a76b7 trans_code
        ../../gcc-4.8.0/gcc/fortran/trans.c:1527
0x5f25fd gfc_trans_integer_select
        ../../gcc-4.8.0/gcc/fortran/trans-stmt.c:1990
0x5f25fd gfc_trans_select(gfc_code*)
        ../../gcc-4.8.0/gcc/fortran/trans-stmt.c:2484
0x5a76c7 trans_code
        ../../gcc-4.8.0/gcc/fortran/trans.c:1543
0x5f0e28 gfc_trans_block_construct(gfc_code*)
        ../../gcc-4.8.0/gcc/fortran/trans-stmt.c:1342
0x5a76b7 trans_code
        ../../gcc-4.8.0/gcc/fortran/trans.c:1527
0x5c4be2 gfc_generate_function_code(gfc_namespace*)
        ../../gcc-4.8.0/gcc/fortran/trans-decl.c:5397
0x5a8091 gfc_generate_module_code(gfc_namespace*)
        ../../gcc-4.8.0/gcc/fortran/trans.c:1755
0x56862b translate_all_program_units
        ../../gcc-4.8.0/gcc/fortran/parse.c:4455
0x56862b gfc_parse_file()
        ../../gcc-4.8.0/gcc/fortran/parse.c:4682
0x5a3c25 gfc_be_parse_file
        ../../gcc-4.8.0/gcc/fortran/f95-lang.c:189


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

* [Bug fortran/57116] ICE for pointer assignment inside SELECT TYPE on UP entity
  2013-04-29 19:53 [Bug fortran/57116] New: ICE for pointer assignment inside SELECT TYPE on UP entity Bader at lrz dot de
@ 2013-04-29 21:54 ` dominiq at lps dot ens.fr
  2013-04-30 12:13 ` [Bug fortran/57116] [OOP] ICE for pointer assignment inside SELECT TYPE janus at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-04-29 21:54 UTC (permalink / raw)
  To: gcc-bugs


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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-04-29
     Ever Confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2013-04-29 21:54:39 UTC ---
Confirmed. The test passes if I define explicitly the bounds, i.e.,

  subroutine extract(this, v, ic)
    class(*), target :: this(:)
    real, pointer :: v(:)
    integer :: ic, m, n
    n = ubound(this,1)
    m = n-ic+1
    select type (this)
    type is (real)
       v(1:m) => this(ic:n)
    class is (foo)
       v(1:m) => this(ic:n)%v
    end select
  end subroutine extract


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

* [Bug fortran/57116] [OOP] ICE for pointer assignment inside SELECT TYPE
  2013-04-29 19:53 [Bug fortran/57116] New: ICE for pointer assignment inside SELECT TYPE on UP entity Bader at lrz dot de
  2013-04-29 21:54 ` [Bug fortran/57116] " dominiq at lps dot ens.fr
@ 2013-04-30 12:13 ` janus at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: janus at gcc dot gnu.org @ 2013-04-30 12:13 UTC (permalink / raw)
  To: gcc-bugs


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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |janus at gcc dot gnu.org
            Summary|CLASS(*) - ICE for pointer  |[OOP] ICE for pointer
                   |assignment inside SELECT    |assignment inside SELECT
                   |TYPE on UP entity           |TYPE

--- Comment #2 from janus at gcc dot gnu.org 2013-04-30 12:13:49 UTC ---
Reduced test case for the ICE, which shows that unlimited polymorphism is not
required to trigger the bug:


  implicit none
  type :: foo
     real :: v
  end type

contains

  subroutine extract(this, v)
    class(foo), target :: this(:)
    real, pointer :: v(:)
    select type (this)
    class is (foo)
       v => this(1:2)%v
    end select
  end subroutine

end


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

end of thread, other threads:[~2013-04-30 12:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-29 19:53 [Bug fortran/57116] New: ICE for pointer assignment inside SELECT TYPE on UP entity Bader at lrz dot de
2013-04-29 21:54 ` [Bug fortran/57116] " dominiq at lps dot ens.fr
2013-04-30 12:13 ` [Bug fortran/57116] [OOP] ICE for pointer assignment inside SELECT TYPE janus at gcc dot gnu.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).