* [Bug fortran/59414] [OOP] Class array pointers: compile error on valid code (Different ranks in pointer assignment)
2013-12-06 18:53 [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment) antony at cosmologist dot info
@ 2013-12-07 11:12 ` janus at gcc dot gnu.org
2013-12-07 11:56 ` janus at gcc dot gnu.org
` (17 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: janus at gcc dot gnu.org @ 2013-12-07 11:12 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-12-07
CC| |janus at gcc dot gnu.org
Summary|Class array pointers: |[OOP] Class array pointers:
|compile error on valid code |compile error on valid code
|(Different ranks in pointer |(Different ranks in pointer
|assignment) |assignment)
Ever confirmed|0 |1
--- Comment #1 from janus at gcc dot gnu.org ---
Confirmed. Thanks for reporting!
Here is a reduced test case, which is sufficient to trigger the error:
implicit none
Type TObjectList
end Type
Class(TObjectList), pointer :: Arr(:)
Arr => ArrayItem()
contains
function ArrayItem() result(P)
Class(TObjectList), pointer :: P(:)
end function
end
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug fortran/59414] [OOP] Class array pointers: compile error on valid code (Different ranks in pointer assignment)
2013-12-06 18:53 [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment) antony at cosmologist dot info
2013-12-07 11:12 ` [Bug fortran/59414] [OOP] " janus at gcc dot gnu.org
@ 2013-12-07 11:56 ` janus at gcc dot gnu.org
2013-12-07 12:33 ` antony at cosmologist dot info
` (16 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: janus at gcc dot gnu.org @ 2013-12-07 11:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414
--- Comment #2 from janus at gcc dot gnu.org ---
This draft patch fixes the error (but has not been regtested yet):
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c (revision 205782)
+++ gcc/fortran/resolve.c (working copy)
@@ -2616,6 +2616,8 @@ found:
expr->ts = sym->ts;
expr->value.function.name = sym->name;
expr->value.function.esym = sym;
+ if (sym->ts.type == BT_CLASS && CLASS_DATA (sym)->as)
+ expr->rank = CLASS_DATA (sym)->as->rank;
if (sym->as != NULL)
expr->rank = sym->as->rank;
With the patch the reduced test case in comment 1 compiles cleanly, but the
full code in comment 0 then gives an ICE on a different location:
ObjectLists.f90: In function ‘addarray’:
ObjectLists.f90:240:0: internal compiler error: in gfc_conv_expr_descriptor, at
fortran/trans-array.c:6473
allocate(Pt%P(1:SIZE(P)), source= P)
^
0x636b4b gfc_conv_expr_descriptor(gfc_se*, gfc_expr*)
/home/jweil/gcc49/trunk/gcc/fortran/trans-array.c:6473
0x65597e gfc_trans_pointer_assignment(gfc_expr*, gfc_expr*)
/home/jweil/gcc49/trunk/gcc/fortran/trans-expr.c:6609
0x676cd1 gfc_trans_allocate(gfc_code*)
/home/jweil/gcc49/trunk/gcc/fortran/trans-stmt.c:5124
0x6269c7 trans_code
/home/jweil/gcc49/trunk/gcc/fortran/trans.c:1778
0x66df53 gfc_trans_if_1
/home/jweil/gcc49/trunk/gcc/fortran/trans-stmt.c:986
0x673d2a gfc_trans_if(gfc_code*)
/home/jweil/gcc49/trunk/gcc/fortran/trans-stmt.c:1017
0x626aa7 trans_code
/home/jweil/gcc49/trunk/gcc/fortran/trans.c:1720
0x674088 gfc_trans_block_construct(gfc_code*)
/home/jweil/gcc49/trunk/gcc/fortran/trans-stmt.c:1344
0x626a37 trans_code
/home/jweil/gcc49/trunk/gcc/fortran/trans.c:1728
0x66df53 gfc_trans_if_1
/home/jweil/gcc49/trunk/gcc/fortran/trans-stmt.c:986
0x673d2a gfc_trans_if(gfc_code*)
/home/jweil/gcc49/trunk/gcc/fortran/trans-stmt.c:1017
0x626aa7 trans_code
/home/jweil/gcc49/trunk/gcc/fortran/trans.c:1720
0x67585d gfc_trans_integer_select
/home/jweil/gcc49/trunk/gcc/fortran/trans-stmt.c:1992
0x67585d gfc_trans_select(gfc_code*)
/home/jweil/gcc49/trunk/gcc/fortran/trans-stmt.c:2486
0x626a47 trans_code
/home/jweil/gcc49/trunk/gcc/fortran/trans.c:1744
0x674088 gfc_trans_block_construct(gfc_code*)
/home/jweil/gcc49/trunk/gcc/fortran/trans-stmt.c:1344
0x626a37 trans_code
/home/jweil/gcc49/trunk/gcc/fortran/trans.c:1728
0x646382 gfc_generate_function_code(gfc_namespace*)
/home/jweil/gcc49/trunk/gcc/fortran/trans-decl.c:5604
0x627ed1 gfc_generate_module_code(gfc_namespace*)
/home/jweil/gcc49/trunk/gcc/fortran/trans.c:1956
0x5da09b translate_all_program_units
/home/jweil/gcc49/trunk/gcc/fortran/parse.c:4523
>From gcc-bugs-return-436943-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Dec 07 12:05:35 2013
Return-Path: <gcc-bugs-return-436943-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 2158 invoked by alias); 7 Dec 2013 12:05:35 -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 2144 invoked by uid 48); 7 Dec 2013 12:05:30 -0000
From: "ville.voutilainen at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/59416] New: A nested template reusing the template arguments of the enclosing type in a template template argument not working
Date: Sat, 07 Dec 2013 12:05:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ville.voutilainen 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-59416-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-12/txt/msg00598.txt.bz2
Content-length: 1661
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59416
Bug ID: 59416
Summary: A nested template reusing the template arguments of
the enclosing type in a template template argument not
working
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ville.voutilainen at gmail dot com
Test:
template<int,int> struct Obj;
template<typename... Ts> struct A {
template<template<Ts...> class> struct B { };
};
int main()
{
A<int,int>::B<Obj> x{ };
}
edoceo3.cpp:8:20: error: type/value mismatch at argument 1 in template
parameter list for ‘template<class ... Ts> template<template<template<Ts
...<anonymous> > class<template-parameter-2-1> > template<class ... Ts>
template<Ts ...<anonymous> > class<template-parameter-2-1> > struct A<Ts>::B’
A<int,int>::B<Obj> x{ };
^
edoceo3.cpp:8:20: error: expected a template of type ‘template<class ... Ts>
template<Ts ...<anonymous> > class<template-parameter-2-1>’, got ‘template<int
<anonymous>, int <anonymous> > struct Obj’
edoceo3.cpp:8:23: error: invalid type in declaration before ‘{’ token
A<int,int>::B<Obj> x{ };
clang compiles this code. It certainly looks valid to me, since in the
attempted instantiation, A's template arguments are 'int,int', and then
the template argument for A::B should be 'template <int, int> class',
and Obj is such a template.
>From gcc-bugs-return-436944-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Dec 07 12:25:21 2013
Return-Path: <gcc-bugs-return-436944-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 14145 invoked by alias); 7 Dec 2013 12:25:21 -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 14105 invoked by uid 48); 7 Dec 2013 12:25:17 -0000
From: "janus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/59414] [OOP] Class array pointers: compile error on valid code (Different ranks in pointer assignment)
Date: Sat, 07 Dec 2013 12:25: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.2
X-Bugzilla-Keywords: rejects-valid
X-Bugzilla-Severity: blocker
X-Bugzilla-Who: janus at gcc dot gnu.org
X-Bugzilla-Status: NEW
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-59414-4-kym0KJyvXt@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59414-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59414-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-12/txt/msg00599.txt.bz2
Content-length: 985
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414
--- Comment #3 from janus at gcc dot gnu.org ---
(In reply to janus from comment #2)
> With the patch the reduced test case in comment 1 compiles cleanly, but the
> full code in comment 0 then gives an ICE on a different location:
>
> ObjectLists.f90: In function ‘addarray’:
> ObjectLists.f90:240:0: internal compiler error: in gfc_conv_expr_descriptor,
> at fortran/trans-array.c:6473
> allocate(Pt%P(1:SIZE(P)), source= P)
Here is a reduced test case for the ICE (which seems unrelated to the original
error):
module ObjectLists
implicit none
type :: t
end type
type Object_array_pointer
class(t), pointer :: p(:)
end type
contains
subroutine AddArray (P, Pt)
class(t) :: P(:)
class(Object_array_pointer) :: Pt
select type (Pt)
class is (Object_array_pointer)
allocate(Pt%P(1:SIZE(P)), source=P)
end select
end subroutine
end module
>From gcc-bugs-return-436945-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Dec 07 12:30:23 2013
Return-Path: <gcc-bugs-return-436945-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 20505 invoked by alias); 7 Dec 2013 12:30:23 -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 20440 invoked by uid 48); 7 Dec 2013 12:30:18 -0000
From: "janus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/59414] [OOP] Class array pointers: compile error on valid code (Different ranks in pointer assignment)
Date: Sat, 07 Dec 2013 12:30: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.2
X-Bugzilla-Keywords: rejects-valid
X-Bugzilla-Severity: blocker
X-Bugzilla-Who: janus at gcc dot gnu.org
X-Bugzilla-Status: NEW
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-59414-4-b3csLU7VxY@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59414-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59414-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-12/txt/msg00600.txt.bz2
Content-length: 298
http://gcc.gnu.org/bugzilla/show_bug.cgi?idY414
--- Comment #4 from janus at gcc dot gnu.org ---
Btw, when using the second (commented-out) version of 'AddArray' (which
apparently crashes with ifort), the full code in comment 0 compiles cleanly
with gfortran trunk plus the patch in comment 2.
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug fortran/59414] [OOP] Class array pointers: compile error on valid code (Different ranks in pointer assignment)
2013-12-06 18:53 [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment) antony at cosmologist dot info
2013-12-07 11:12 ` [Bug fortran/59414] [OOP] " janus at gcc dot gnu.org
2013-12-07 11:56 ` janus at gcc dot gnu.org
@ 2013-12-07 12:33 ` antony at cosmologist dot info
2013-12-07 12:46 ` janus at gcc dot gnu.org
` (15 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: antony at cosmologist dot info @ 2013-12-07 12:33 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414
--- Comment #5 from Antony Lewis <antony at cosmologist dot info> ---
Thanks for the quick fix!
The sourced allocate errors crop up in various places in the full code, and
already seem to be known in several bug reports, e.g.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44672
For example in this case you just get a compiler error:
module test
Type InterpGrid2D
REAL, pointer :: z(:,:) => NULL()
contains
procedure :: Init => InterpGrid2D_Init
end Type InterpGrid2D
contains
subroutine InterpGrid2D_Init(W, z)
class(InterpGrid2D):: W
REAL, INTENT(IN), pointer :: z(:,:)
allocate(W%z, source = z)
end subroutine InterpGrid2D_Init
end module
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug fortran/59414] [OOP] Class array pointers: compile error on valid code (Different ranks in pointer assignment)
2013-12-06 18:53 [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment) antony at cosmologist dot info
` (2 preceding siblings ...)
2013-12-07 12:33 ` antony at cosmologist dot info
@ 2013-12-07 12:46 ` janus at gcc dot gnu.org
2013-12-07 14:04 ` dominiq at lps dot ens.fr
` (14 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: janus at gcc dot gnu.org @ 2013-12-07 12:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414
--- Comment #6 from janus at gcc dot gnu.org ---
(In reply to Antony Lewis from comment #5)
> The sourced allocate errors crop up in various places in the full code, and
> already seem to be known in several bug reports, e.g.
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44672
>
> For example in this case you just get a compiler error:
Yes, this error is the one described in PR44672, but the issue of comment 3 is
somewhat different. Not sure if there is already a PR for it. In fact comment 3
compiles cleanly with 4.7, so the ICE seems to be a regression in 4.8.
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug fortran/59414] [OOP] Class array pointers: compile error on valid code (Different ranks in pointer assignment)
2013-12-06 18:53 [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment) antony at cosmologist dot info
` (3 preceding siblings ...)
2013-12-07 12:46 ` janus at gcc dot gnu.org
@ 2013-12-07 14:04 ` dominiq at lps dot ens.fr
2013-12-07 14:26 ` janus at gcc dot gnu.org
` (13 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-12-07 14:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414
--- Comment #7 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
The issue of comment 3 appeared between revisions 187190 (2012-05-05) and
187198 (actually 187193 and I'ld bet for 187192).
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug fortran/59414] [OOP] Class array pointers: compile error on valid code (Different ranks in pointer assignment)
2013-12-06 18:53 [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment) antony at cosmologist dot info
` (4 preceding siblings ...)
2013-12-07 14:04 ` dominiq at lps dot ens.fr
@ 2013-12-07 14:26 ` janus at gcc dot gnu.org
2013-12-07 15:13 ` janus at gcc dot gnu.org
` (12 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: janus at gcc dot gnu.org @ 2013-12-07 14:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414
--- Comment #8 from janus at gcc dot gnu.org ---
The patch in comment 2 regtests cleanly.
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug fortran/59414] [OOP] Class array pointers: compile error on valid code (Different ranks in pointer assignment)
2013-12-06 18:53 [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment) antony at cosmologist dot info
` (5 preceding siblings ...)
2013-12-07 14:26 ` janus at gcc dot gnu.org
@ 2013-12-07 15:13 ` janus at gcc dot gnu.org
2013-12-07 16:59 ` kargl at gcc dot gnu.org
` (11 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: janus at gcc dot gnu.org @ 2013-12-07 15:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pault at gcc dot gnu.org
--- Comment #9 from janus at gcc dot gnu.org ---
(In reply to Dominique d'Humieres from comment #7)
> The issue of comment 3 appeared between revisions 187190 (2012-05-05) and
> 187198 (actually 187193 and I'ld bet for 187192).
r187192 was Paul's fix for PR 41600.
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug fortran/59414] [OOP] Class array pointers: compile error on valid code (Different ranks in pointer assignment)
2013-12-06 18:53 [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment) antony at cosmologist dot info
` (6 preceding siblings ...)
2013-12-07 15:13 ` janus at gcc dot gnu.org
@ 2013-12-07 16:59 ` kargl at gcc dot gnu.org
2013-12-07 19:27 ` janus at gcc dot gnu.org
` (10 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: kargl at gcc dot gnu.org @ 2013-12-07 16:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
Severity|blocker |normal
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug fortran/59414] [OOP] Class array pointers: compile error on valid code (Different ranks in pointer assignment)
2013-12-06 18:53 [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment) antony at cosmologist dot info
` (7 preceding siblings ...)
2013-12-07 16:59 ` kargl at gcc dot gnu.org
@ 2013-12-07 19:27 ` janus at gcc dot gnu.org
2013-12-07 19:30 ` janus at gcc dot gnu.org
` (9 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: janus at gcc dot gnu.org @ 2013-12-07 19:27 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414
--- Comment #10 from janus at gcc dot gnu.org ---
Author: janus
Date: Sat Dec 7 19:27:19 2013
New Revision: 205785
URL: http://gcc.gnu.org/viewcvs?rev=205785&root=gcc&view=rev
Log:
2013-12-07 Janus Weil <janus@gcc.gnu.org>
PR fortran/59414
* resolve.c (resolve_specific_f0): Handle CLASS-valued functions.
2013-12-07 Janus Weil <janus@gcc.gnu.org>
PR fortran/59414
* gfortran.dg/class_result_2.f90: New.
Added:
trunk/gcc/testsuite/gfortran.dg/class_result_2.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug fortran/59414] [OOP] Class array pointers: compile error on valid code (Different ranks in pointer assignment)
2013-12-06 18:53 [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment) antony at cosmologist dot info
` (8 preceding siblings ...)
2013-12-07 19:27 ` janus at gcc dot gnu.org
@ 2013-12-07 19:30 ` janus at gcc dot gnu.org
2013-12-19 15:21 ` [Bug fortran/59414] [4.8/4.9 Regression] [OOP] ICE in in gfc_conv_expr_descriptor on ALLOCATE inside SELECT TYPE rguenth at gcc dot gnu.org
` (8 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: janus at gcc dot gnu.org @ 2013-12-07 19:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414
--- Comment #11 from janus at gcc dot gnu.org ---
r205785 fixes the original error (i.e. comment 1). ToDo: The ICE regression of
comment 3.
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug fortran/59414] [4.8/4.9 Regression] [OOP] ICE in in gfc_conv_expr_descriptor on ALLOCATE inside SELECT TYPE
2013-12-06 18:53 [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment) antony at cosmologist dot info
` (9 preceding siblings ...)
2013-12-07 19:30 ` janus at gcc dot gnu.org
@ 2013-12-19 15:21 ` rguenth at gcc dot gnu.org
2014-01-19 12:34 ` pault at gcc dot gnu.org
` (7 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-19 15:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.8.3
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug fortran/59414] [4.8/4.9 Regression] [OOP] ICE in in gfc_conv_expr_descriptor on ALLOCATE inside SELECT TYPE
2013-12-06 18:53 [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment) antony at cosmologist dot info
` (10 preceding siblings ...)
2013-12-19 15:21 ` [Bug fortran/59414] [4.8/4.9 Regression] [OOP] ICE in in gfc_conv_expr_descriptor on ALLOCATE inside SELECT TYPE rguenth at gcc dot gnu.org
@ 2014-01-19 12:34 ` pault at gcc dot gnu.org
2014-01-19 21:06 ` pault at gcc dot gnu.org
` (6 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: pault at gcc dot gnu.org @ 2014-01-19 12:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414
--- Comment #12 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to janus from comment #3)
....snip....
>
> module ObjectLists
> implicit none
>
> type :: t
> end type
>
> type Object_array_pointer
> class(t), pointer :: p(:)
> end type
>
> contains
>
> subroutine AddArray (P, Pt)
> class(t) :: P(:)
> class(Object_array_pointer) :: Pt
>
> select type (Pt)
> class is (Object_array_pointer)
ICE disappears with type is (Object_array_pointer)
> allocate(Pt%P(1:SIZE(P)), source=P)
> end select
> end subroutine
>
> end module
Paul
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug fortran/59414] [4.8/4.9 Regression] [OOP] ICE in in gfc_conv_expr_descriptor on ALLOCATE inside SELECT TYPE
2013-12-06 18:53 [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment) antony at cosmologist dot info
` (11 preceding siblings ...)
2014-01-19 12:34 ` pault at gcc dot gnu.org
@ 2014-01-19 21:06 ` pault at gcc dot gnu.org
2014-01-26 14:31 ` mikael at gcc dot gnu.org
` (5 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: pault at gcc dot gnu.org @ 2014-01-19 21:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414
Paul Thomas <pault at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |pault at gcc dot gnu.org
--- Comment #13 from Paul Thomas <pault at gcc dot gnu.org> ---
Created attachment 31894
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31894&action=edit
Patch for the PR
This patch bootstraps and regtests on trunk. The resulting behaviour is
identical to ifort.
I'll submit tomorrow or Tuesday.
Cheers
Paul
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug fortran/59414] [4.8/4.9 Regression] [OOP] ICE in in gfc_conv_expr_descriptor on ALLOCATE inside SELECT TYPE
2013-12-06 18:53 [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment) antony at cosmologist dot info
` (12 preceding siblings ...)
2014-01-19 21:06 ` pault at gcc dot gnu.org
@ 2014-01-26 14:31 ` mikael at gcc dot gnu.org
2014-01-26 17:41 ` paul.richard.thomas at gmail dot com
` (4 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: mikael at gcc dot gnu.org @ 2014-01-26 14:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414
Mikael Morin <mikael at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mikael at gcc dot gnu.org
--- Comment #14 from Mikael Morin <mikael at gcc dot gnu.org> ---
patch at:
http://gcc.gnu.org/ml/fortran/2014-01/msg00086.html
approved at:
http://gcc.gnu.org/ml/fortran/2014-01/msg00086.html
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug fortran/59414] [4.8/4.9 Regression] [OOP] ICE in in gfc_conv_expr_descriptor on ALLOCATE inside SELECT TYPE
2013-12-06 18:53 [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment) antony at cosmologist dot info
` (13 preceding siblings ...)
2014-01-26 14:31 ` mikael at gcc dot gnu.org
@ 2014-01-26 17:41 ` paul.richard.thomas at gmail dot com
2014-01-28 20:11 ` pault at gcc dot gnu.org
` (3 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: paul.richard.thomas at gmail dot com @ 2014-01-26 17:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414
--- Comment #15 from paul.richard.thomas at gmail dot com <paul.richard.thomas at gmail dot com> ---
I hadn't forgotten - I will be back in France tomorrow night and will deal
with it then.
Cheers
Paul
On Jan 26, 2014 3:31 PM, "mikael at gcc dot gnu.org" <
gcc-bugzilla@gcc.gnu.org> wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414
>
> Mikael Morin <mikael at gcc dot gnu.org> changed:
>
> What |Removed |Added
>
> ----------------------------------------------------------------------------
> CC| |mikael at gcc dot gnu.org
>
> --- Comment #14 from Mikael Morin <mikael at gcc dot gnu.org> ---
> patch at:
> http://gcc.gnu.org/ml/fortran/2014-01/msg00086.html
> approved at:
> http://gcc.gnu.org/ml/fortran/2014-01/msg00086.html
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
> You are the assignee for the bug.
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug fortran/59414] [4.8/4.9 Regression] [OOP] ICE in in gfc_conv_expr_descriptor on ALLOCATE inside SELECT TYPE
2013-12-06 18:53 [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment) antony at cosmologist dot info
` (14 preceding siblings ...)
2014-01-26 17:41 ` paul.richard.thomas at gmail dot com
@ 2014-01-28 20:11 ` pault at gcc dot gnu.org
2014-01-28 20:18 ` [Bug fortran/59414] [4.8 " pault at gcc dot gnu.org
` (2 subsequent siblings)
18 siblings, 0 replies; 20+ messages in thread
From: pault at gcc dot gnu.org @ 2014-01-28 20:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414
--- Comment #16 from Paul Thomas <pault at gcc dot gnu.org> ---
Author: pault
Date: Tue Jan 28 20:10:22 2014
New Revision: 207204
URL: http://gcc.gnu.org/viewcvs?rev=207204&root=gcc&view=rev
Log:
2014-01-28 Paul Thomas <pault@gcc.gnu.org>
PR fortran/59414
* trans-stmt.c (gfc_trans_allocate): Before the pointer
assignment to transfer the source _vptr to a class allocate
expression, the final class reference should be exposed. The
tail that includes the _data and array references is stored.
This reduced expression is transferred to 'lhs' and the _vptr
added. Then the tail is restored to the allocate expression.
2014-01-28 Paul Thomas <pault@gcc.gnu.org>
PR fortran/59414
* gfortran.dg/allocate_class_3.f90 : New test
Added:
trunk/gcc/testsuite/gfortran.dg/allocate_class_3.f90
trunk/gcc/testsuite/gfortran.dg/elemental_by_value_1.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-stmt.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug fortran/59414] [4.8 Regression] [OOP] ICE in in gfc_conv_expr_descriptor on ALLOCATE inside SELECT TYPE
2013-12-06 18:53 [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment) antony at cosmologist dot info
` (15 preceding siblings ...)
2014-01-28 20:11 ` pault at gcc dot gnu.org
@ 2014-01-28 20:18 ` pault at gcc dot gnu.org
2014-02-01 22:32 ` pault at gcc dot gnu.org
2014-02-01 22:34 ` pault at gcc dot gnu.org
18 siblings, 0 replies; 20+ messages in thread
From: pault at gcc dot gnu.org @ 2014-01-28 20:18 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414
Paul Thomas <pault at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.8/4.9 Regression] [OOP] |[4.8 Regression] [OOP] ICE
|ICE in in |in in
|gfc_conv_expr_descriptor on |gfc_conv_expr_descriptor on
|ALLOCATE inside SELECT TYPE |ALLOCATE inside SELECT TYPE
--- Comment #17 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to Paul Thomas from comment #16)
> Author: pault
> Date: Tue Jan 28 20:10:22 2014
> New Revision: 207204
...snip...
> trunk/gcc/testsuite/gfortran.dg/elemental_by_value_1.f90
This was accidental and was removed in r207205. Sorry about the noise.
Paul
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug fortran/59414] [4.8 Regression] [OOP] ICE in in gfc_conv_expr_descriptor on ALLOCATE inside SELECT TYPE
2013-12-06 18:53 [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment) antony at cosmologist dot info
` (16 preceding siblings ...)
2014-01-28 20:18 ` [Bug fortran/59414] [4.8 " pault at gcc dot gnu.org
@ 2014-02-01 22:32 ` pault at gcc dot gnu.org
2014-02-01 22:34 ` pault at gcc dot gnu.org
18 siblings, 0 replies; 20+ messages in thread
From: pault at gcc dot gnu.org @ 2014-02-01 22:32 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414
--- Comment #18 from Paul Thomas <pault at gcc dot gnu.org> ---
Author: pault
Date: Sat Feb 1 22:31:53 2014
New Revision: 207390
URL: http://gcc.gnu.org/viewcvs?rev=207390&root=gcc&view=rev
Log:
2014-02-01 Paul Thomas <pault@gcc.gnu.org>
PR fortran/59414
* trans-stmt.c (gfc_trans_allocate): Before the pointer
assignment to transfer the source _vptr to a class allocate
expression, the final class reference should be exposed. The
tail that includes the _data and array references is stored.
This reduced expression is transferred to 'lhs' and the _vptr
added. Then the tail is restored to the allocate expression.
2014-02-01 Paul Thomas <pault@gcc.gnu.org>
PR fortran/59414
* gfortran.dg/allocate_class_3.f90 : New test
Added:
branches/gcc-4_8-branch/gcc/testsuite/gfortran.dg/allocate_class_3.f90
Modified:
branches/gcc-4_8-branch/gcc/fortran/ChangeLog
branches/gcc-4_8-branch/gcc/fortran/trans-stmt.c
branches/gcc-4_8-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug fortran/59414] [4.8 Regression] [OOP] ICE in in gfc_conv_expr_descriptor on ALLOCATE inside SELECT TYPE
2013-12-06 18:53 [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment) antony at cosmologist dot info
` (17 preceding siblings ...)
2014-02-01 22:32 ` pault at gcc dot gnu.org
@ 2014-02-01 22:34 ` pault at gcc dot gnu.org
18 siblings, 0 replies; 20+ messages in thread
From: pault at gcc dot gnu.org @ 2014-02-01 22:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59414
Paul Thomas <pault at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #19 from Paul Thomas <pault at gcc dot gnu.org> ---
Thanks for the report - fixed on 4.8 and 4.9
Paul
^ permalink raw reply [flat|nested] 20+ messages in thread