From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5785 invoked by alias); 6 Feb 2012 21:34:22 -0000 Received: (qmail 5544 invoked by uid 22791); 6 Feb 2012 21:34:21 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,SUBJ_OBFU_PUNCT_FEW,SUBJ_OBFU_PUNCT_MANY,TW_VP X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Feb 2012 21:34:09 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/52143] New: [OOP] ICE with polymorphic function result in gfc_class_vptr_get Date: Mon, 06 Feb 2012 21:34:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-02/txt/msg00651.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52143 Bug #: 52143 Summary: [OOP] ICE with polymorphic function result in gfc_class_vptr_get Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: burnus@gcc.gnu.org CC: pault@gcc.gnu.org Found when creating a test case for PR 51514. The following code causes an test.f90:8:0: internal compiler error: tree check: expected record_type or union_type or qual_union_type, have function_type in gfc_class_vptr_get, at fortran/trans-expr.c:78 which is at vptr = gfc_advance_chain (TYPE_FIELDS (TREE_TYPE (decl)), CLASS_VPTR_FIELD); Backtrace: #0 gfc_class_vptr_get (decl=0x2aaaacce2600) at trans-expr.c:78 #1 0x00000000005d3f0d in gfc_vtable_field_get (decl=, field=1) at trans-expr.c:91 #2 0x00000000005b1fa5 in build_class_array_ref (index=0x2aaaacbc3c90, base=0x2aaaacced2a8, se=) at trans-array.c:2984 #3 gfc_conv_scalarized_array_ref (se=0x7fffffffce20, ar=) at trans-array.c:3037 #4 0x00000000005b2852 in gfc_conv_array_ref (se=0x7fffffffce20, ar=0x174a888, sym=, where=) at trans-array.c:3112 #5 0x00000000005db098 in gfc_conv_variable (se=0x7fffffffce20, expr=0x174a620) at trans-expr.c:1333 #6 0x00000000005da874 in gfc_conv_expr_reference (se=0x7fffffffce20, expr=) at trans-expr.c:5610 #7 0x00000000005de0b0 in gfc_conv_procedure_call (se=0x7fffffffcff0, sym=0x173e1f0, args=0x1746b50, expr=0x174aa10, append_args=0x0) at trans-expr.c:3540 #8 0x00000000006020c5 in gfc_trans_call (code=0x174af90, dependency_check=, mask=0x0, count1=0x0, invert=false) at trans-stmt.c:468 module mod_subpr type :: foo integer :: i = 2 end type contains function g () class(foo), allocatable :: g(:) allocate (g(3)) end function g end module