[Bug fortran/51052] [OOP] Internal compiler error in gfc_conv_component
burnus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Nov 9 13:23:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51052
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code
CC| |burnus at gcc dot gnu.org,
| |janus at gcc dot gnu.org
Summary|Internal compiler error in |[OOP] Internal compiler
|gfc_conv_component |error in gfc_conv_component
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-11-09 13:03:56 UTC ---
I can confirm the ICE - I get the same with 4.6 and 4.7.
Note, however, that with GCC 4.7 one has to fix the following coding problem
before one can enjoy the internal error:
particles.f90:102.17:
procedure, pass(particle) &
1
Error: Argument mismatch for the overriding procedure 'new_position' at (1):
INTENT mismatch in argument 'particle'
The issue seems to occur for:
position = position + deltt * velocity + &
random_displacement
in subroutine position_oil_particle if particles.f90.
The ICE is in gfc_conv_component_ref for:
if (DECL_FIELD_CONTEXT (field) != TREE_TYPE (decl))
{
tree f2 = c->norestrict_decl;
if (!f2 || DECL_FIELD_CONTEXT (f2) != TREE_TYPE (decl))
for (f2 = TYPE_FIELDS (TREE_TYPE (decl)); f2; f2 = DECL_CHAIN (f2))
and fails for "TYPE_FIELDS (TREE_TYPE (decl))" with: "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"
This is called by gfc_conv_variable, which is called by get_proc_ptr_comp. The
expression looks as follow
"position%__class_points2d3d_Point2d_p%__vtype_points2d3d_Point2d%__class_points2d3d_Point2d_a%__vtype_points2d3d_Point2d"
At least that's what I get when printing expr->symtree->n.sym->name and
expr->ref{,->next,->next->next,...}->u.c.sym->name.
More information about the Gcc-bugs
mailing list