public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/42335]  New: [OOP] ICE on CLASS IS (bad_identifier)
@ 2009-12-08 21:46 anlauf at gmx dot de
  2009-12-09 18:03 ` [Bug fortran/42335] " janus at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: anlauf at gmx dot de @ 2009-12-08 21:46 UTC (permalink / raw)
  To: gcc-bugs

Hi,

the following (invalid) code gives an ICE:

module gfcbug95
  implicit none
  type, abstract :: vector_class
  end type vector_class

  type, extends(vector_class) :: trivial_vector_type
    real :: elements(100)
  end type trivial_vector_type
contains
  subroutine bar (this,v)
    class(trivial_vector_type), intent(inout) :: this
    class(vector_class),        intent(in)    :: v

    select type (v)
!   class is (trivial_vector_type) ! OK
    class is (bad_id)              ! ICE
       this%elements(:) = v%elements(:)
    end select
  end subroutine bar
end module gfcbug95

% gfc45 gfcbug95.f90
gfcbug95.f90:16.20:

    class is (bad_id)              ! ICE
                    1
Error: 'bad_id' at (1) is not an accessible derived type
f951: internal compiler error: Segmentation fault

Cheers,
-ha


-- 
           Summary: [OOP] ICE on CLASS IS (bad_identifier)
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: anlauf at gmx dot de


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


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

* [Bug fortran/42335] [OOP] ICE on CLASS IS (bad_identifier)
  2009-12-08 21:46 [Bug fortran/42335] New: [OOP] ICE on CLASS IS (bad_identifier) anlauf at gmx dot de
@ 2009-12-09 18:03 ` janus at gcc dot gnu dot org
  2009-12-09 18:06 ` janus at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-12-09 18:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from janus at gcc dot gnu dot org  2009-12-09 18:03 -------

> Error: 'bad_id' at (1) is not an accessible derived type
> f951: internal compiler error: Segmentation fault

Confirmed. The same happens for TYPE IS (bad_id).


-- 

janus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-12-09 18:03:21
               date|                            |


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


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

* [Bug fortran/42335] [OOP] ICE on CLASS IS (bad_identifier)
  2009-12-08 21:46 [Bug fortran/42335] New: [OOP] ICE on CLASS IS (bad_identifier) anlauf at gmx dot de
  2009-12-09 18:03 ` [Bug fortran/42335] " janus at gcc dot gnu dot org
@ 2009-12-09 18:06 ` janus at gcc dot gnu dot org
  2009-12-09 18:17 ` janus at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-12-09 18:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from janus at gcc dot gnu dot org  2009-12-09 18:06 -------
Backtrace:

#0  0x0000000000549274 in gfc_find_sym_tree (name=0x7fffffffd840 "v",
ns=0x17a28b0, parent_flag=1, result=0x7fffffffd750)
    at /home/jweil/gcc45/fortran-dev/gcc/fortran/symbol.c:2507
#1  0x000000000054970e in gfc_get_ha_sym_tree (name=0x7fffffffd840 "v",
result=0x7fffffffd7d0) at
/home/jweil/gcc45/fortran-dev/gcc/fortran/symbol.c:2679
#2  0x0000000000517810 in gfc_match_rvalue (result=0x7fffffffd908) at
/home/jweil/gcc45/fortran-dev/gcc/fortran/primary.c:2505
#3  0x00000000004fdadf in match_primary (result=0x7fffffffd908) at
/home/jweil/gcc45/fortran-dev/gcc/fortran/matchexp.c:161
#4  0x00000000004fdc5a in match_level_1 (result=0x7fffffffd960) at
/home/jweil/gcc45/fortran-dev/gcc/fortran/matchexp.c:234
#5  0x00000000004fdd0a in match_mult_operand (result=0x7fffffffd9c0) at
/home/jweil/gcc45/fortran-dev/gcc/fortran/matchexp.c:288
#6  0x00000000004fdf06 in match_add_operand (result=0x7fffffffda08) at
/home/jweil/gcc45/fortran-dev/gcc/fortran/matchexp.c:377
#7  0x00000000004fe1b2 in match_level_2 (result=0x7fffffffda60) at
/home/jweil/gcc45/fortran-dev/gcc/fortran/matchexp.c:501
#8  0x00000000004fe33c in match_level_3 (result=0x7fffffffdac0) at
/home/jweil/gcc45/fortran-dev/gcc/fortran/matchexp.c:572
#9  0x00000000004fe43b in match_level_4 (result=0x7fffffffdb10) at
/home/jweil/gcc45/fortran-dev/gcc/fortran/matchexp.c:620
#10 0x00000000004fe6c9 in match_and_operand (result=0x7fffffffdb60) at
/home/jweil/gcc45/fortran-dev/gcc/fortran/matchexp.c:714
#11 0x00000000004fe74d in match_or_operand (result=0x7fffffffdbb0) at
/home/jweil/gcc45/fortran-dev/gcc/fortran/matchexp.c:743
#12 0x00000000004fe84c in match_equiv_operand (result=0x7fffffffdc00) at
/home/jweil/gcc45/fortran-dev/gcc/fortran/matchexp.c:786
#13 0x00000000004fe94b in match_level_5 (result=0x7fffffffdc50) at
/home/jweil/gcc45/fortran-dev/gcc/fortran/matchexp.c:832
#14 0x00000000004fea89 in gfc_match_expr (result=0x7fffffffddc8) at
/home/jweil/gcc45/fortran-dev/gcc/fortran/matchexp.c:891
#15 0x00000000004f751e in gfc_match (target=0x10f534e " %e%t") at
/home/jweil/gcc45/fortran-dev/gcc/fortran/match.c:1102
#16 0x00000000004f7b53 in gfc_match_assignment () at
/home/jweil/gcc45/fortran-dev/gcc/fortran/match.c:1300


-- 


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


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

* [Bug fortran/42335] [OOP] ICE on CLASS IS (bad_identifier)
  2009-12-08 21:46 [Bug fortran/42335] New: [OOP] ICE on CLASS IS (bad_identifier) anlauf at gmx dot de
  2009-12-09 18:03 ` [Bug fortran/42335] " janus at gcc dot gnu dot org
  2009-12-09 18:06 ` janus at gcc dot gnu dot org
@ 2009-12-09 18:17 ` janus at gcc dot gnu dot org
  2009-12-11 14:41 ` janus at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-12-09 18:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from janus at gcc dot gnu dot org  2009-12-09 18:17 -------
Mine.

I think this one-liner is all that's needed:

Index: gcc/fortran/symbol.c
===================================================================
--- gcc/fortran/symbol.c        (revision 155023)
+++ gcc/fortran/symbol.c        (working copy)
@@ -2476,7 +2476,7 @@ select_type_insert_tmp (gfc_symtree **st)
 {
   gfc_select_type_stack *stack = select_type_stack;
   for (; stack; stack = stack->prev)
-    if ((*st)->n.sym == stack->selector)
+    if ((*st)->n.sym == stack->selector && stack->tmp)
       *st = stack->tmp;
 }


With this, the test case gives:

c0.f90:16.20:

    class is (bad_id)              ! ICE
                    1
Error: 'bad_id' at (1) is not an accessible derived type
c0.f90:17.36:

       this%elements(:) = v%elements(:)
                                    1
Error: 'elements' at (1) is not a member of the 'vector_class' structure


-- 

janus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |janus at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2009-12-09 18:03:21         |2009-12-09 18:17:30
               date|                            |


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


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

* [Bug fortran/42335] [OOP] ICE on CLASS IS (bad_identifier)
  2009-12-08 21:46 [Bug fortran/42335] New: [OOP] ICE on CLASS IS (bad_identifier) anlauf at gmx dot de
                   ` (2 preceding siblings ...)
  2009-12-09 18:17 ` janus at gcc dot gnu dot org
@ 2009-12-11 14:41 ` janus at gcc dot gnu dot org
  2009-12-11 15:02 ` janus at gcc dot gnu dot org
  2009-12-22 17:59 ` hjl dot tools at gmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-12-11 14:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from janus at gcc dot gnu dot org  2009-12-11 14:40 -------
Subject: Bug 42335

Author: janus
Date: Fri Dec 11 14:40:36 2009
New Revision: 155162

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155162
Log:
gcc/fortran/
2009-12-11 Janus Weil  <janus@gcc.gnu.org>

        PR fortran/42335
        * symbol.c (select_type_insert_tmp): Add an extra check for
        error recovery.


gcc/testsuite/
2009-12-11  Janus Weil  <janus@gcc.gnu.org>

        PR fortran/42335
        * gfortran.dg/select_type_11.f03: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/select_type_11.f03
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/symbol.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/42335] [OOP] ICE on CLASS IS (bad_identifier)
  2009-12-08 21:46 [Bug fortran/42335] New: [OOP] ICE on CLASS IS (bad_identifier) anlauf at gmx dot de
                   ` (3 preceding siblings ...)
  2009-12-11 14:41 ` janus at gcc dot gnu dot org
@ 2009-12-11 15:02 ` janus at gcc dot gnu dot org
  2009-12-22 17:59 ` hjl dot tools at gmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-12-11 15:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from janus at gcc dot gnu dot org  2009-12-11 15:02 -------
Fixed with r155162. Thanks for the report.


-- 

janus at gcc dot gnu dot org changed:

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


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


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

* [Bug fortran/42335] [OOP] ICE on CLASS IS (bad_identifier)
  2009-12-08 21:46 [Bug fortran/42335] New: [OOP] ICE on CLASS IS (bad_identifier) anlauf at gmx dot de
                   ` (4 preceding siblings ...)
  2009-12-11 15:02 ` janus at gcc dot gnu dot org
@ 2009-12-22 17:59 ` hjl dot tools at gmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-12-22 17:59 UTC (permalink / raw)
  To: gcc-bugs



-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.5.0


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


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

end of thread, other threads:[~2009-12-22 17:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-08 21:46 [Bug fortran/42335] New: [OOP] ICE on CLASS IS (bad_identifier) anlauf at gmx dot de
2009-12-09 18:03 ` [Bug fortran/42335] " janus at gcc dot gnu dot org
2009-12-09 18:06 ` janus at gcc dot gnu dot org
2009-12-09 18:17 ` janus at gcc dot gnu dot org
2009-12-11 14:41 ` janus at gcc dot gnu dot org
2009-12-11 15:02 ` janus at gcc dot gnu dot org
2009-12-22 17:59 ` hjl dot tools at gmail dot com

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