[Bug fortran/44213] ICE when extending abstract type

2010-05-22 Thread janus at gcc dot gnu dot org


--- Comment #3 from janus at gcc dot gnu dot org  2010-05-22 10:21 ---
Subject: Bug 44213

Author: janus
Date: Sat May 22 10:21:32 2010
New Revision: 159695

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=159695
Log:
2010-05-22  Janus Weil  ja...@gcc.gnu.org

PR fortran/44213
* resolve.c (ensure_not_abstract): Allow abstract types with
non-abstract ancestors.


2010-05-22  Janus Weil  ja...@gcc.gnu.org

PR fortran/44213
* gfortran.dg/abstract_type_7.f03: New.

Added:
trunk/gcc/testsuite/gfortran.dg/abstract_type_7.f03
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44213



[Bug fortran/44213] ICE when extending abstract type

2010-05-22 Thread janus at gcc dot gnu dot org


--- Comment #4 from janus at gcc dot gnu dot org  2010-05-22 10:25 ---
Fixed with r159695. Closing.

Thanks to Hans for the report!


-- 

janus at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44213



[Bug fortran/44213] ICE when extending abstract type

2010-05-20 Thread janus at gcc dot gnu dot org


--- Comment #1 from janus at gcc dot gnu dot org  2010-05-20 20:24 ---
My first feeling was that this would be illegal, but I could not find anything
in the standard supporting this feeling. F03 only has the following
restrictions:

C427 (R429) If the type de#64257;nition contains or inherits (4.5.6.1) a
deferred binding (4.5.4), ABSTRACT shall appear.

C428(R429) If ABSTRACT appears, the type shall be extensible.


-- 

janus at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Keywords||ice-on-valid-code
  Known to fail||4.6.0
   Last reconfirmed|-00-00 00:00:00 |2010-05-20 20:24:30
   date||
Summary|[OOP] ICE when extending|ICE when extending abstract
   |abstract type   |type
   Target Milestone|--- |4.6.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44213



[Bug fortran/44213] ICE when extending abstract type

2010-05-20 Thread janus at gcc dot gnu dot org


--- Comment #2 from janus at gcc dot gnu dot org  2010-05-20 20:36 ---
The ICE is fixed by this more or less obvious patch:

Index: gcc/fortran/resolve.c
===
--- gcc/fortran/resolve.c   (revision 159561)
+++ gcc/fortran/resolve.c   (working copy)
@@ -10556,10 +10556,10 @@ ensure_not_abstract (gfc_symbol* sub, gfc_symbol*
  This is not the most efficient way to do this, but it should be ok and is
  clearer than something sophisticated.  */

-  gcc_assert (ancestor  ancestor-attr.abstract  !sub-attr.abstract);
+  gcc_assert (ancestor  !sub-attr.abstract);

   /* Walk bindings of this ancestor.  */
-  if (ancestor-f2k_derived)
+  if (ancestor-attr.abstract  ancestor-f2k_derived)
 {
   gfc_try t;
   t = ensure_not_abstract_walker (sub,
ancestor-f2k_derived-tb_sym_root);


-- 

janus at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |janus at gcc dot gnu dot org
   |dot org |
 Status|NEW |ASSIGNED
   Last reconfirmed|2010-05-20 20:24:30 |2010-05-20 20:36:07
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44213