public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/41587] [OOP] ICE with ALLOCATABLE CLASS components
[not found] <bug-41587-4@http.gcc.gnu.org/bugzilla/>
@ 2012-02-02 23:13 ` mikael at gcc dot gnu.org
2012-02-02 23:37 ` mikael at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: mikael at gcc dot gnu.org @ 2012-02-02 23:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41587
--- Comment #4 from Mikael Morin <mikael at gcc dot gnu.org> 2012-02-02 23:11:01 UTC ---
Author: mikael
Date: Thu Feb 2 23:10:55 2012
New Revision: 183853
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183853
Log:
2012-02-02 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/41587
PR fortran/46356
PR fortran/51754
PR fortran/50981
* class.c (insert_component_ref, class_data_ref_missing,
gfc_fix_class_refs): New functions.
* gfortran.h (gfc_fix_class_refs): New prototype.
* trans-expr.c (gfc_conv_expr): Remove special case handling and call
gfc_fix_class_refs instead.
2012-02-02 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/41587
* gfortran.dg/class_array_10.f03: New test.
PR fortran/46356
* gfortran.dg/class_array_11.f03: New test.
PR fortran/51754
* gfortran.dg/class_array_12.f03: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/class_array_10.f03
trunk/gcc/testsuite/gfortran.dg/class_array_11.f03
trunk/gcc/testsuite/gfortran.dg/class_array_12.f03
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/class.c
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/trans-expr.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/41587] [OOP] ICE with ALLOCATABLE CLASS components
[not found] <bug-41587-4@http.gcc.gnu.org/bugzilla/>
2012-02-02 23:13 ` [Bug fortran/41587] [OOP] ICE with ALLOCATABLE CLASS components mikael at gcc dot gnu.org
@ 2012-02-02 23:37 ` mikael at gcc dot gnu.org
2012-02-03 7:35 ` burnus at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: mikael at gcc dot gnu.org @ 2012-02-02 23:37 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41587
Mikael Morin <mikael at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Last reconfirmed| |2012-02-02
CC| |mikael at gcc dot gnu.org
Resolution|FIXED |
Ever Confirmed|0 |1
--- Comment #5 from Mikael Morin <mikael at gcc dot gnu.org> 2012-02-02 23:37:09 UTC ---
(In reply to comment #1)
> I don't get an ICE with the coed in comment#0. However I get one with the
> following (valid?) changes:
>
> type t0
> integer :: j = 42
> end type t0
> type t
> integer :: i
> class(t0), allocatable :: foo(:)
> end type t
> type(t) :: k
> allocate(t0 :: k%foo(3))
> print *, k%foo%j
> end
>
> pr41587_db.f90: In function 'MAIN__':
> pr41587_db.f90:9:0: internal compiler error: in gfc_conv_descriptor_data_get,
> at fortran/trans-array.c:147
>
The ICE is gone, but the program above prints 0 0 42 instead of 42 42 42.
Reopening...
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/41587] [OOP] ICE with ALLOCATABLE CLASS components
[not found] <bug-41587-4@http.gcc.gnu.org/bugzilla/>
2012-02-02 23:13 ` [Bug fortran/41587] [OOP] ICE with ALLOCATABLE CLASS components mikael at gcc dot gnu.org
2012-02-02 23:37 ` mikael at gcc dot gnu.org
@ 2012-02-03 7:35 ` burnus at gcc dot gnu.org
2012-02-06 14:21 ` pault at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-02-03 7:35 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41587
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-02-03 07:34:27 UTC ---
(In reply to comment #5)
> The ICE is gone, but the program above prints 0 0 42 instead of 42 42 42.
> Reopening...
For completeness: comment 0 is also not fixed. The program is accepted although
it is invalid. The following error message is missing: "Allocatable component
of structure at (1) must have a deferred shape"
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/41587] [OOP] ICE with ALLOCATABLE CLASS components
[not found] <bug-41587-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2012-02-03 7:35 ` burnus at gcc dot gnu.org
@ 2012-02-06 14:21 ` pault at gcc dot gnu.org
2012-04-23 12:59 ` burnus at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu.org @ 2012-02-06 14:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41587
Paul Thomas <pault at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pault at gcc dot gnu.org
--- Comment #7 from Paul Thomas <pault at gcc dot gnu.org> 2012-02-06 14:20:22 UTC ---
As of yesterday, the testcase in comment #1 compiles and runs successfully. We
now just need the error message for the original problem.
Cheers
Paul
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/41587] [OOP] ICE with ALLOCATABLE CLASS components
[not found] <bug-41587-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2012-02-06 14:21 ` pault at gcc dot gnu.org
@ 2012-04-23 12:59 ` burnus at gcc dot gnu.org
2012-05-06 20:33 ` burnus at gcc dot gnu.org
2012-05-06 20:49 ` burnus at gcc dot gnu.org
6 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-04-23 12:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41587
--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-04-23 12:59:24 UTC ---
(In reply to comment #7)
> As of yesterday, the testcase in comment #1 compiles and runs
> successfully. We now just need the error message for the original problem.
Untested patch:
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -1626,5 +1626,8 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr
- if (c->attr.pointer)
+ if (c->attr.pointer
+ || (c->ts.type == BT_CLASS && CLASS_DATA (c)
+ && CLASS_DATA (c)->attr.class_pointer))
{
- if (c->as->type != AS_DEFERRED)
+ if ((c->ts.type == BT_CLASS && CLASS_DATA (c)->as->type != AS_DEFERRED)
+ || (c->ts.type != BT_CLASS && c->as->type != AS_DEFERRED))
{
@@ -1635,5 +1638,8 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr
}
- else if (c->attr.allocatable)
+ else if (c->attr.allocatable
+ || (c->ts.type == BT_CLASS && CLASS_DATA (c)
+ && CLASS_DATA (c)->attr.allocatable))
{
- if (c->as->type != AS_DEFERRED)
+ if ((c->ts.type == BT_CLASS && CLASS_DATA (c)->as->type != AS_DEFERRED)
+ || (c->ts.type != BT_CLASS && c->as->type != AS_DEFERRED))
{
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/41587] [OOP] ICE with ALLOCATABLE CLASS components
[not found] <bug-41587-4@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2012-04-23 12:59 ` burnus at gcc dot gnu.org
@ 2012-05-06 20:33 ` burnus at gcc dot gnu.org
2012-05-06 20:49 ` burnus at gcc dot gnu.org
6 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-05-06 20:33 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41587
--- Comment #9 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-05-06 20:30:13 UTC ---
Author: burnus
Date: Sun May 6 20:30:05 2012
New Revision: 187214
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187214
Log:
2012-05-06 Tobias Burnus <burnus@net-b.de>
PR fortran/41587
* decl.c (build_struct): Don't ignore FAILED status.
2012-05-06 Tobias Burnus <burnus@net-b.de>
PR fortran/41587
* gfortran.dg/class_array_13.f90: New.
Added:
trunk/gcc/testsuite/gfortran.dg/class_array_13.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/decl.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/41587] [OOP] ICE with ALLOCATABLE CLASS components
[not found] <bug-41587-4@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2012-05-06 20:33 ` burnus at gcc dot gnu.org
@ 2012-05-06 20:49 ` burnus at gcc dot gnu.org
6 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-05-06 20:49 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41587
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution| |FIXED
--- Comment #10 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-05-06 20:32:55 UTC ---
(In reply to comment #7)
> As of yesterday, the testcase in comment #1 compiles and runs successfully. We
> now just need the error message for the original problem.
Which has now been FIXED on the 4.8 trunk. (The other issues were fixed on the
4.7 trunk.)
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/41587] [OOP] ICE with ALLOCATABLE CLASS components
2009-10-05 13:31 [Bug fortran/41587] New: " burnus at gcc dot gnu dot org
2009-10-14 8:42 ` [Bug fortran/41587] " dominiq at lps dot ens dot fr
2009-10-17 18:10 ` pault at gcc dot gnu dot org
@ 2009-10-18 12:25 ` pault at gcc dot gnu dot org
2 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu dot org @ 2009-10-18 12:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pault at gcc dot gnu dot org 2009-10-18 12:25 -------
Fixed on trunk.
Thanks for the report!
Paul
--
pault at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41587
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/41587] [OOP] ICE with ALLOCATABLE CLASS components
2009-10-05 13:31 [Bug fortran/41587] New: " burnus at gcc dot gnu dot org
2009-10-14 8:42 ` [Bug fortran/41587] " dominiq at lps dot ens dot fr
@ 2009-10-17 18:10 ` pault at gcc dot gnu dot org
2009-10-18 12:25 ` pault at gcc dot gnu dot org
2 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu dot org @ 2009-10-17 18:10 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pault at gcc dot gnu dot org 2009-10-17 18:09 -------
Subject: Bug 41587
Author: pault
Date: Sat Oct 17 18:09:25 2009
New Revision: 152955
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152955
Log:
2009-10-17 Janus Weil <janus@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/41608
* decl.c (gfc_match_data_decl): Add BT_CLASS for undefined type
and empty type errors.
* parse.c (gfc_build_block_ns): Only set recursive if parent ns
has a proc_name.
PR fortran/41629
PR fortran/41618
PR fortran/41587
* gfortran.h : Add class_ok bitfield to symbol_attr.
* decl.c (build_sym): Set attr.class_ok if dummy, pointer or
allocatable.
(build_struct): Use gfc_try 't' to carry errors past the call
to encapsulate_class_symbol.
(attr_decl1): For a CLASS object, apply the new attribute to
the data component.
* match.c (gfc_match_select_type): Set attr.class_ok for an
assigned selector.
* resolve.c (resolve_fl_variable_derived): Check a CLASS object
is dummy, pointer or allocatable by testing the class_ok and
the use_assoc attribute.
2009-10-17 Janus Weil <janus@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/41629
* gfortran.dg/class_6.f90: New test.
PR fortran/41608
PR fortran/41587
* gfortran.dg/class_7.f90: New test.
PR fortran/41618
* gfortran.dg/class_8.f90: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/class_6.f03
trunk/gcc/testsuite/gfortran.dg/class_7.f03
trunk/gcc/testsuite/gfortran.dg/class_8.f03
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/decl.c
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/match.c
trunk/gcc/fortran/parse.c
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41587
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/41587] [OOP] ICE with ALLOCATABLE CLASS components
2009-10-05 13:31 [Bug fortran/41587] New: " burnus at gcc dot gnu dot org
@ 2009-10-14 8:42 ` dominiq at lps dot ens dot fr
2009-10-17 18:10 ` pault at gcc dot gnu dot org
2009-10-18 12:25 ` pault at gcc dot gnu dot org
2 siblings, 0 replies; 10+ messages in thread
From: dominiq at lps dot ens dot fr @ 2009-10-14 8:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from dominiq at lps dot ens dot fr 2009-10-14 08:42 -------
I don't get an ICE with the coed in comment#0. However I get one with the
following (valid?) changes:
type t0
integer :: j = 42
end type t0
type t
integer :: i
class(t0), allocatable :: foo(:)
end type t
type(t) :: k
allocate(t0 :: k%foo(3))
print *, k%foo%j
end
pr41587_db.f90: In function 'MAIN__':
pr41587_db.f90:9:0: internal compiler error: in gfc_conv_descriptor_data_get,
at fortran/trans-array.c:147
Note that with the patch in http://gcc.gnu.org/ml/fortran/2009-10/msg00136.html
, I get the following error for the code in comment#0:
pr41587.f90:6.34:
class(t0), allocatable :: foo(3)
1
Error: Allocatable component of structure at (1) must have a deferred shape
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41587
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-05-06 20:33 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-41587-4@http.gcc.gnu.org/bugzilla/>
2012-02-02 23:13 ` [Bug fortran/41587] [OOP] ICE with ALLOCATABLE CLASS components mikael at gcc dot gnu.org
2012-02-02 23:37 ` mikael at gcc dot gnu.org
2012-02-03 7:35 ` burnus at gcc dot gnu.org
2012-02-06 14:21 ` pault at gcc dot gnu.org
2012-04-23 12:59 ` burnus at gcc dot gnu.org
2012-05-06 20:33 ` burnus at gcc dot gnu.org
2012-05-06 20:49 ` burnus at gcc dot gnu.org
2009-10-05 13:31 [Bug fortran/41587] New: " burnus at gcc dot gnu dot org
2009-10-14 8:42 ` [Bug fortran/41587] " dominiq at lps dot ens dot fr
2009-10-17 18:10 ` pault at gcc dot gnu dot org
2009-10-18 12:25 ` pault at gcc dot gnu dot 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).