This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/48360] [4.6/4.7 Regression] ICE on array assignment statement with allocatable LHS
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 30 Mar 2011 11:56:05 +0000
- Subject: [Bug fortran/48360] [4.6/4.7 Regression] ICE on array assignment statement with allocatable LHS
- Auto-submitted: auto-generated
- References: <bug-48360-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48360
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code
CC| |burnus at gcc dot gnu.org,
| |pault at gcc dot gnu.org
Target Milestone|--- |4.6.1
Summary|ICE on array assignment |[4.6/4.7 Regression] ICE on
|statement with allocatable |array assignment statement
|LHS |with allocatable LHS
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-03-30 11:55:51 UTC ---
(In reply to comment #0)
> Disabling the possibility of "allocate-on-assignment" by changing
[...]
Or simply use: -fno-realloc-lhs
With my - admittedly not clean - tree, that gives the following valgrind
output:
Invalid read of size 8
at 0x56B13A: get_std_lbound (trans-array.c:6825)
by 0x573E88: gfc_alloc_allocatable_for_assignment (trans-array.c:7083)
by 0x58EBDB: gfc_trans_assignment_1 (trans-expr.c:6186)
That's the lines:
6822 else if (expr->expr_type == EXPR_VARIABLE)
6823 {
6824 tmp = TREE_TYPE (expr->symtree->n.sym->backend_decl);
6825 return GFC_TYPE_ARRAY_LBOUND(tmp, dim);
The issue is that
TYPE_LANG_SPECIFIC (tmp) == tmp->type.lang_specific == NULL
and, thus, accessing TYPE_LANG_SPECIFIC(node)->lbound[dim] gives an ICE.
The issue is that for "mmv%h0" the proper backend is not:
expr->symtree->n.sym->backend_decl
but rather
expr->ref->u.c->component->backend_decl