public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/58652] New: ICE with move_alloc and unlimited polymorphic
@ 2013-10-06 22:26 vladimir.fuka at gmail dot com
2013-10-07 7:52 ` [Bug fortran/58652] " burnus at gcc dot gnu.org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: vladimir.fuka at gmail dot com @ 2013-10-06 22:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58652
Bug ID: 58652
Summary: ICE with move_alloc and unlimited polymorphic
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: vladimir.fuka at gmail dot com
class(*),allocatable :: a
class(*),allocatable :: c
call move_alloc(a,c)
end
gfortran starallocatable.f90
starallocatable.f90: In function ‘MAIN__’:
starallocatable.f90:4:0: internal compiler error: Neoprávněný přístup do paměti
(SIGSEGV)
call move_alloc(a,c)
^
0x8ba79f crash_signal
../../gcc-4.8-20130509/gcc/toplev.c:332
0x5fb7ed gfc_get_symbol_decl(gfc_symbol*)
../../gcc-4.8-20130509/gcc/fortran/trans-decl.c:1215
0x61c8ac conv_intrinsic_move_alloc
../../gcc-4.8-20130509/gcc/fortran/trans-intrinsic.c:7430
0x61c8ac gfc_conv_intrinsic_subroutine(gfc_code*)
../../gcc-4.8-20130509/gcc/fortran/trans-intrinsic.c:7577
0x5e3872 trans_code
../../gcc-4.8-20130509/gcc/fortran/trans.c:1490
0x600c92 gfc_generate_function_code(gfc_namespace*)
../../gcc-4.8-20130509/gcc/fortran/trans-decl.c:5397
0x5a49d0 translate_all_program_units
../../gcc-4.8-20130509/gcc/fortran/parse.c:4474
0x5a49d0 gfc_parse_file()
../../gcc-4.8-20130509/gcc/fortran/parse.c:4688
0x5dfd15 gfc_be_parse_file
../../gcc-4.8-20130509/gcc/fortran/f95-lang.c:189
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
>From gcc-bugs-return-431218-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Oct 06 22:46:46 2013
Return-Path: <gcc-bugs-return-431218-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 32671 invoked by alias); 6 Oct 2013 22:46:44 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 32623 invoked by uid 48); 6 Oct 2013 22:46:39 -0000
From: "vladimir.fuka at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/58652] ICE with move_alloc and unlimited polymorphic
Date: Sun, 06 Oct 2013 22:46:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.8.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: vladimir.fuka at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-58652-4-Oeo3VP7xQn@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58652-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58652-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-10/txt/msg00362.txt.bz2
Content-length: 1045
http://gcc.gnu.org/bugzilla/show_bug.cgi?idX652
--- Comment #1 from Vladimir Fuka <vladimir.fuka at gmail dot com> ---
maybe connected:
module gen_lists
type list_node
class(*),allocatable :: item
contains
procedure :: move_alloc => list_move_alloc
end type
contains
subroutine list_move_alloc(self,item)
class(list_node),intent(inout) :: self
class(*),intent(inout),allocatable :: item
call move_alloc(item, self%item)
end subroutine
end module
module lists
use gen_lists, only: node => list_node
end module lists
module sexp
use lists
contains
subroutine parse(ast)
class(*), allocatable, intent(out) :: ast
class(*), allocatable :: expr
integer :: ierr
allocate(node::ast)
select type (ast)
type is (node)
call ast%move_alloc(expr)
end select
end subroutine
end module
starallocatable2.f90:52.28:
call ast%move_alloc(expr)
1
Error: Actual argument to 'item' at (1) must have the same declared type
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/58652] ICE with move_alloc and unlimited polymorphic
2013-10-06 22:26 [Bug fortran/58652] New: ICE with move_alloc and unlimited polymorphic vladimir.fuka at gmail dot com
@ 2013-10-07 7:52 ` burnus at gcc dot gnu.org
2013-10-14 21:26 ` burnus at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-10-07 7:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58652
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code,
| |rejects-valid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-10-07
CC| |burnus at gcc dot gnu.org
Ever confirmed|0 |1
Known to fail| |4.8.1, 4.9.0
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
I see the same error with 4.9 - and both code snippets seem to be valid -> ICE
on valid + rejects valid.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/58652] ICE with move_alloc and unlimited polymorphic
2013-10-06 22:26 [Bug fortran/58652] New: ICE with move_alloc and unlimited polymorphic vladimir.fuka at gmail dot com
2013-10-07 7:52 ` [Bug fortran/58652] " burnus at gcc dot gnu.org
@ 2013-10-14 21:26 ` burnus at gcc dot gnu.org
2013-10-15 6:14 ` burnus at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-10-14 21:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58652
--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Patch for comment 0. The previous check didn't work as one added a component
ref to from_expr:
if (UNLIMITED_POLY (from_expr))
vtab = NULL;
...
gfc_add_vptr_component (from_expr);
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -7641,3 +7641,4 @@ conv_intrinsic_move_alloc (gfc_code *code)
/* Reset _vptr component to declared type. */
- if (UNLIMITED_POLY (from_expr))
+ if (vtab == NULL)
+ /* Unlimited polymorphic. */
gfc_add_modify_loc (input_location, &block, from_se.expr,
@@ -7697,3 +7698,4 @@ conv_intrinsic_move_alloc (gfc_code *code)
/* Reset _vptr component to declared type. */
- if (UNLIMITED_POLY (from_expr))
+ if (vtab == NULL)
+ /* Unlimited polymorphic. */
gfc_add_modify_loc (input_location, &block, from_se.expr,
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/58652] ICE with move_alloc and unlimited polymorphic
2013-10-06 22:26 [Bug fortran/58652] New: ICE with move_alloc and unlimited polymorphic vladimir.fuka at gmail dot com
2013-10-07 7:52 ` [Bug fortran/58652] " burnus at gcc dot gnu.org
2013-10-14 21:26 ` burnus at gcc dot gnu.org
@ 2013-10-15 6:14 ` burnus at gcc dot gnu.org
2013-10-15 6:20 ` burnus at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-10-15 6:14 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58652
--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Author: burnus
Date: Tue Oct 15 06:14:35 2013
New Revision: 203586
URL: http://gcc.gnu.org/viewcvs?rev=203586&root=gcc&view=rev
Log:
2013-10-15 Tobias Burnus <burnus@net-b.de>
PR fortran/58652
* trans-intrinsic.c (conv_intrinsic_move_alloc): Fix handling
of CLASS(*) variables.
2013-10-15 Tobias Burnus <burnus@net-b.de>
PR fortran/58652
* gfortran.dg/unlimited_polymorphic_11.f90: New.
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-intrinsic.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/58652] ICE with move_alloc and unlimited polymorphic
2013-10-06 22:26 [Bug fortran/58652] New: ICE with move_alloc and unlimited polymorphic vladimir.fuka at gmail dot com
` (2 preceding siblings ...)
2013-10-15 6:14 ` burnus at gcc dot gnu.org
@ 2013-10-15 6:20 ` burnus at gcc dot gnu.org
2013-10-15 6:24 ` burnus at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-10-15 6:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58652
--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Author: burnus
Date: Tue Oct 15 06:20:01 2013
New Revision: 203587
URL: http://gcc.gnu.org/viewcvs?rev=203587&root=gcc&view=rev
Log:
Add missing file from previous commit r203586:
2013-10-15 Tobias Burnus <burnus@net-b.de>
PR fortran/58652
* gfortran.dg/unlimited_polymorphic_11.f90: New.
Added:
trunk/gcc/testsuite/gfortran.dg/unlimited_polymorphic_11.f90
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/58652] ICE with move_alloc and unlimited polymorphic
2013-10-06 22:26 [Bug fortran/58652] New: ICE with move_alloc and unlimited polymorphic vladimir.fuka at gmail dot com
` (3 preceding siblings ...)
2013-10-15 6:20 ` burnus at gcc dot gnu.org
@ 2013-10-15 6:24 ` burnus at gcc dot gnu.org
2013-10-16 20:46 ` burnus at gcc dot gnu.org
2013-10-16 20:48 ` burnus at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-10-15 6:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58652
--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Patch for the issue in comment 1:
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -1993,2 +1993,3 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
- if (!gfc_compare_derived_types (CLASS_DATA (actual)->ts.u.derived,
- CLASS_DATA (formal)->ts.u.derived))
+ if (!UNLIMITED_POLY (formal)
+ && !gfc_compare_derived_types (CLASS_DATA (actual)->ts.u.derived,
+ CLASS_DATA (formal)->ts.u.derived))
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/58652] ICE with move_alloc and unlimited polymorphic
2013-10-06 22:26 [Bug fortran/58652] New: ICE with move_alloc and unlimited polymorphic vladimir.fuka at gmail dot com
` (4 preceding siblings ...)
2013-10-15 6:24 ` burnus at gcc dot gnu.org
@ 2013-10-16 20:46 ` burnus at gcc dot gnu.org
2013-10-16 20:48 ` burnus at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-10-16 20:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58652
--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Author: burnus
Date: Wed Oct 16 20:46:33 2013
New Revision: 203720
URL: http://gcc.gnu.org/viewcvs?rev=203720&root=gcc&view=rev
Log:
2013-10-16 Tobias Burnus <burnus@net-b.de>
PR fortran/58652
* interface.c (compare_parameter): Accept passing CLASS(*)
to CLASS(*).
2013-10-16 Tobias Burnus <burnus@net-b.de>
PR fortran/58652
* gfortran.dg/unlimited_polymorphic_12.f90: New.
Added:
trunk/gcc/testsuite/gfortran.dg/unlimited_polymorphic_12.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/interface.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/58652] ICE with move_alloc and unlimited polymorphic
2013-10-06 22:26 [Bug fortran/58652] New: ICE with move_alloc and unlimited polymorphic vladimir.fuka at gmail dot com
` (5 preceding siblings ...)
2013-10-16 20:46 ` burnus at gcc dot gnu.org
@ 2013-10-16 20:48 ` burnus at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-10-16 20:48 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58652
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Now also the second issue is FIXED on the trunk (4.9).
(With a correct version of the patch, comment 6 permitted too much.)
Thanks for the report!
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-10-16 20:48 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-06 22:26 [Bug fortran/58652] New: ICE with move_alloc and unlimited polymorphic vladimir.fuka at gmail dot com
2013-10-07 7:52 ` [Bug fortran/58652] " burnus at gcc dot gnu.org
2013-10-14 21:26 ` burnus at gcc dot gnu.org
2013-10-15 6:14 ` burnus at gcc dot gnu.org
2013-10-15 6:20 ` burnus at gcc dot gnu.org
2013-10-15 6:24 ` burnus at gcc dot gnu.org
2013-10-16 20:46 ` burnus at gcc dot gnu.org
2013-10-16 20:48 ` burnus 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).