public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/51334] New: [OOP] ICE with type-bound operator: tree check: expected record_type or union_type or qual_union_type, have function_type in gfc_conv_component_ref, at fortran/trans-expr.c:556
@ 2011-11-28 17:39 burnus at gcc dot gnu.org
2011-11-28 17:59 ` [Bug fortran/51334] " burnus at gcc dot gnu.org
2012-01-02 13:08 ` pault at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-11-28 17:39 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51334
Bug #: 51334
Summary: [OOP] ICE with type-bound operator: tree check:
expected record_type or union_type or qual_union_type,
have function_type in gfc_conv_component_ref, at
fortran/trans-expr.c:556
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: janus@gcc.gnu.org
Created attachment 25938
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25938
Failing program
Found at
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/d9df983132fcc643
Arjen Markus reports there that his program ICEs with GCC 4.6; it also does so
with GCC the trunk. It does compile with ifort 12.1 (but not with 12.0);
however, there are unresolved symbols with ifort 12.1. It fails to compile with
PGI 11.5 and crayftn 7.1.4.111, but those errors look bogus.
In gfortran 4.7:
Test.f90: In function ‘test_pde_solver’:
Test.f90:375:0: internal compiler error: tree check: expected record_type or
union_type or qual_union_type, have function_type in gfc_conv_component_ref, at
fortran/trans-expr.c:556
The line of interest is:
deriv = diff * solution%nabla2()
The ICE is in gfc_conv_component_ref; debugging shows:
(gdb) p c->name
$2 = 0x2aaaacf09050 "_vptr"
(gdb) p debug_tree(decl)
<indirect_ref 0x2aaaacf1baa0
type <function_type 0x2aaaacf0e738
type <record_type 0x2aaaacf069d8
__class_base_pde_objects_Base_pde_object_a BLK
[...]
It looks as if the constructor patch causes the generation of a function decl
instead of an record decl. However, given that the problem also occurs with
4.7, there seems to be something else broken as well.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug fortran/51334] [OOP] ICE with type-bound operator: tree check: expected record_type or union_type or qual_union_type, have function_type in gfc_conv_component_ref, at fortran/trans-expr.c:556
2011-11-28 17:39 [Bug fortran/51334] New: [OOP] ICE with type-bound operator: tree check: expected record_type or union_type or qual_union_type, have function_type in gfc_conv_component_ref, at fortran/trans-expr.c:556 burnus at gcc dot gnu.org
@ 2011-11-28 17:59 ` burnus at gcc dot gnu.org
2012-01-02 13:08 ` pault at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-11-28 17:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51334
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Depends on| |46328
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-11-28 17:39:08 UTC ---
The issue seems to be again the nested operators. One has for:
deriv = diff * solution%nabla2()
an outer obj_assign_obj(obj1, obj2) operator and as inner operator the RHS ==
obj2, which is "real_times_obj", defined as:
function real_times_obj( factor, obj ) result(newobj)
real, intent(in) :: factor
class(base_pde_object), intent(in) :: obj
class(base_pde_object), allocatable :: newobj
As further nesting level, there is the inner nabla2() function, which returns
again at CLASS:
function nabla2( obj )
class(base_pde_object), intent(in) :: obj
class(base_pde_object), allocatable :: nabla2
And at some point one needs to access (expr->vtab->(procedure))(expr->value)
which fails without a temporary.
Thus, I think this bug is effectively a duplicate of PR 46328.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug fortran/51334] [OOP] ICE with type-bound operator: tree check: expected record_type or union_type or qual_union_type, have function_type in gfc_conv_component_ref, at fortran/trans-expr.c:556
2011-11-28 17:39 [Bug fortran/51334] New: [OOP] ICE with type-bound operator: tree check: expected record_type or union_type or qual_union_type, have function_type in gfc_conv_component_ref, at fortran/trans-expr.c:556 burnus at gcc dot gnu.org
2011-11-28 17:59 ` [Bug fortran/51334] " burnus at gcc dot gnu.org
@ 2012-01-02 13:08 ` pault at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: pault at gcc dot gnu.org @ 2012-01-02 13:08 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51334
Paul Thomas <pault at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |pault at gcc dot gnu.org
Resolution| |FIXED
--- Comment #2 from Paul Thomas <pault at gcc dot gnu.org> 2012-01-02 13:08:18 UTC ---
Fixed on trunk by r182796. (Forgot to put this in the ChangeLogs!).
Thanks for the report
Paul
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-01-02 13:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-28 17:39 [Bug fortran/51334] New: [OOP] ICE with type-bound operator: tree check: expected record_type or union_type or qual_union_type, have function_type in gfc_conv_component_ref, at fortran/trans-expr.c:556 burnus at gcc dot gnu.org
2011-11-28 17:59 ` [Bug fortran/51334] " burnus at gcc dot gnu.org
2012-01-02 13:08 ` pault 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).