[Bug fortran/45827] [4.6 Regression] [OOP] mio_component_ref(): Component not found

2011-01-03 Thread boschmann at tp1 dot physik.uni-siegen.de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45827

--- Comment #44 from Hans-Werner Boschmann boschmann at tp1 dot 
physik.uni-siegen.de 2011-01-03 12:55:53 UTC ---
I've run my project on R168414, there are no error messages so far. Thank you
all for making this fix, this bug has bothered me for a long time.


[Bug fortran/45827] [4.6 Regression] [OOP] mio_component_ref(): Component not found

2011-01-03 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45827

janus at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #45 from janus at gcc dot gnu.org 2011-01-03 13:14:13 UTC ---
(In reply to comment #44)
 I've run my project on R168414, there are no error messages so far.

Great, thanks for checking. I'm closing this bug as fixed.


[Bug fortran/45827] [4.6 Regression] [OOP] mio_component_ref(): Component not found

2011-01-02 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45827

--- Comment #43 from janus at gcc dot gnu.org 2011-01-02 21:27:48 UTC ---
Hans, does r168302 fix the problem for you, or do you still get Component not
found errors?


[Bug fortran/45827] [4.6 Regression] [OOP] mio_component_ref(): Component not found

2010-12-31 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45827

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P4
 CC||jakub at gcc dot gnu.org


[Bug fortran/45827] [4.6 Regression] [OOP] mio_component_ref(): Component not found

2010-12-28 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45827

--- Comment #37 from janus at gcc dot gnu.org 2010-12-28 08:14:46 UTC ---
(In reply to comment #36)
 (In reply to comment #35)
  Yes, I think I know what's going on. One way to fix it is the following:
 
 I managed to get an ICE with your version (sym == NULL)

No, that's not possible. My version (i.e. comment #35) is inserted at a
slightly different place than yours, where the existence of 'sym' is already
established. Also I have checked that it regtests cleanly. Ok if I commit it to
trunk?


[Bug fortran/45827] [4.6 Regression] [OOP] mio_component_ref(): Component not found

2010-12-28 Thread dfranke at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45827

--- Comment #38 from Daniel Franke dfranke at gcc dot gnu.org 2010-12-28 
12:22:48 UTC ---
Created attachment 22856
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=22856
testcase, ICE with patch in comment #35

(In reply to comment #37)
  I managed to get an ICE with your version (sym == NULL)
 
 No, that's not possible. My version (i.e. comment #35) is inserted at a
 slightly different place than yours, where the existence of 'sym' is already
 established.

Err, sure it is possible:

+  if (sym-attr.is_class)
+   sym = sym-components-ts.u.derived;

After this, sym is not checked any more and the ICE occurs in the next line:

   if (sym-components != NULL  p-u.pointer == NULL)
   ^^^

That's why I moved it up a few lines and double check that sym really is
non-NULL.


[Bug fortran/45827] [4.6 Regression] [OOP] mio_component_ref(): Component not found

2010-12-28 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45827

--- Comment #39 from janus at gcc dot gnu.org 2010-12-28 13:18:41 UTC ---
(In reply to comment #38)
   I managed to get an ICE with your version (sym == NULL)
  
  No, that's not possible. My version (i.e. comment #35) is inserted at a
  slightly different place than yours, where the existence of 'sym' is already
  established.
 
 Err, sure it is possible:

Ok, I get it. Sorry about the misconception. Feel free to commit the patch in
comment #36 (provided it regtests ok). Or should I take care of it?


[Bug fortran/45827] [4.6 Regression] [OOP] mio_component_ref(): Component not found

2010-12-28 Thread dfranke at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45827

--- Comment #40 from Daniel Franke dfranke at gcc dot gnu.org 2010-12-28 
17:27:00 UTC ---
(In reply to comment #39)
 Ok, I get it. Sorry about the misconception. Feel free to commit the patch in
 comment #36 (provided it regtests ok). Or should I take care of it?

Please, you did the hard work - it's yours :)

Regression tested on i686-pc-linux-gnu - there is one regression in
realloc_on_assign_2.f03, but that does not seem to be related to this patch?!


[Bug fortran/45827] [4.6 Regression] [OOP] mio_component_ref(): Component not found

2010-12-28 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45827

--- Comment #41 from janus at gcc dot gnu.org 2010-12-28 18:53:19 UTC ---
(In reply to comment #40)
  Feel free to commit the patch in
  comment #36 (provided it regtests ok). Or should I take care of it?
 
 Please, you did the hard work - it's yours :)

Alright, will commit shortly.


 Regression tested on i686-pc-linux-gnu - there is one regression in
 realloc_on_assign_2.f03, but that does not seem to be related to this patch?!

No, it's unrelated. For me this failure only appears for simple builds, but not
if I do a full boostrap. Maybe one should open a PR for it.

Anyway, thanks for regtesting.


[Bug fortran/45827] [4.6 Regression] [OOP] mio_component_ref(): Component not found

2010-12-28 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45827

--- Comment #42 from janus at gcc dot gnu.org 2010-12-28 21:21:56 UTC ---
Author: janus
Date: Tue Dec 28 21:21:53 2010
New Revision: 168302

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=168302
Log:
2010-12-28  Janus Weil  ja...@gcc.gnu.org
Daniel Franke  dfra...@gcc.gnu.org

PR fortran/45827
* module.c (mio_component_ref): Handle components of CLASS variables.


2010-12-28  Janus Weil  ja...@gcc.gnu.org

PR fortran/45827
* gfortran.dg/class_32.f90: New.

Added:
trunk/gcc/testsuite/gfortran.dg/class_32.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/module.c
trunk/gcc/testsuite/ChangeLog


[Bug fortran/45827] [4.6 Regression] [OOP] mio_component_ref(): Component not found

2010-12-27 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45827

janus at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 AssignedTo|unassigned at gcc dot   |janus at gcc dot gnu.org
   |gnu.org |
Summary|[4.6 Regression]|[4.6 Regression] [OOP]
   |mio_component_ref():|mio_component_ref():
   |Component not found |Component not found

--- Comment #35 from janus at gcc dot gnu.org 2010-12-27 15:36:44 UTC ---
(In reply to comment #34)
 Does this help?

Yes, I think I know what's going on. One way to fix it is the following:

Index: gcc/fortran/module.c
===
--- gcc/fortran/module.c(revision 168019)
+++ gcc/fortran/module.c(working copy)
@@ -2317,6 +2317,9 @@ mio_component_ref (gfc_component **cp, gfc_symbol
   if (sym == NULL)
return;

+  if (sym-attr.is_class)
+   sym = sym-components-ts.u.derived;
+  
   if (sym-components != NULL  p-u.pointer == NULL)
{
  /* Symbol already loaded, so search by name.  */


[Bug fortran/45827] [4.6 Regression] [OOP] mio_component_ref(): Component not found

2010-12-27 Thread dfranke at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45827

--- Comment #36 from Daniel Franke dfranke at gcc dot gnu.org 2010-12-27 
22:18:27 UTC ---
(In reply to comment #35)
 Yes, I think I know what's going on. One way to fix it is the following:

I managed to get an ICE with your version (sym == NULL), this seems to work
(not regtested):

Index: module.c
===
--- module.c(revision 168256)
+++ module.c(working copy)
@@ -2311,6 +2311,9 @@
 {
   mio_internal_string (name);

+  if (sym  sym-attr.is_class)
+sym = sym-components-ts.u.derived;
+
   /* It can happen that a component reference can be read before the
 associated derived type symbol has been loaded. Return now and
 wait for a later iteration of load_needed.  */