[Bug fortran/50227] [4.7 Regression] [OOP] ICE-on-valid with allocatable class variable

2016-11-16 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50227

janus at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |4.7.0

[Bug fortran/50227] [4.7 Regression] [OOP] ICE-on-valid with allocatable class variable

2011-09-04 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50227

janus at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #17 from janus at gcc dot gnu.org 2011-09-04 10:50:22 UTC ---
Fixed with r178509. Closing.

Thanks for the report, Andrew!


[Bug fortran/50227] [4.7 Regression] [OOP] ICE-on-valid with allocatable class variable

2011-09-04 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50227

--- Comment #16 from janus at gcc dot gnu.org 2011-09-04 10:49:18 UTC ---
Author: janus
Date: Sun Sep  4 10:49:13 2011
New Revision: 178509

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178509
Log:
2011-09-04  Janus Weil  

PR fortran/50227
* trans-types.c (gfc_sym_type): Check for proc_name.

2011-09-04  Janus Weil  

PR fortran/50227
* gfortran.dg/class_45a.f03: New.
* gfortran.dg/class_45b.f03: New.

Added:
trunk/gcc/testsuite/gfortran.dg/class_45a.f03
trunk/gcc/testsuite/gfortran.dg/class_45b.f03
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-types.c
trunk/gcc/testsuite/ChangeLog


[Bug fortran/50227] [4.7 Regression] [OOP] ICE-on-valid with allocatable class variable

2011-09-04 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50227

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 |

--- Comment #15 from janus at gcc dot gnu.org 2011-09-04 10:46:15 UTC ---
I should probably take this one. There was a patch posted at

http://gcc.gnu.org/ml/fortran/2011-09/msg1.html

which I am about to commit.


[Bug fortran/50227] [4.7 Regression] [OOP] ICE-on-valid with allocatable class variable

2011-08-31 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50227

--- Comment #14 from janus at gcc dot gnu.org 2011-08-31 11:28:41 UTC ---
(In reply to comment #13)
> > gfortran-4.7 -c module.f90
> > gfortran-4.7 program.f90
> 
> What about
> gfortran-4.7 program.f90 module.o?
> AFAIK there is not "object" in the *.mod files.

Of course. If I fail to include all object files in the linking process, I
should not be too surprised about linker errors. Sorry about the noise,
yesterday just wasn't my day :(


[Bug fortran/50227] [4.7 Regression] [OOP] ICE-on-valid with allocatable class variable

2011-08-30 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50227

--- Comment #13 from Dominique d'Humieres  
2011-08-30 17:24:31 UTC ---
> gfortran-4.7 -c module.f90
> gfortran-4.7 program.f90

What about
gfortran-4.7 program.f90 module.o?
AFAIK there is not "object" in the *.mod files.


[Bug fortran/50227] [4.7 Regression] [OOP] ICE-on-valid with allocatable class variable

2011-08-30 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50227

--- Comment #12 from janus at gcc dot gnu.org 2011-08-30 17:09:22 UTC ---
(In reply to comment #11)
> And indeed it seems to fix the segfault.

... and regtests cleanly.


Unfortunately, there is one more complication: When compiling the two files
from comment #1 one after the other, one gets a linker error:

> gfortran-4.7 -c module.f90
> gfortran-4.7 program.f90
/tmp/ccU0pMIF.o: In function `MAIN__':
program.f90:(.text+0x16): undefined reference to
`__g_nodes_MOD___vtab_g_nodes_T0'
program.f90:(.text+0x87): undefined reference to
`__g_nodes_MOD___vtab_g_nodes_T1'


Note: This seems to happen with trunk and 4.6, while it works with 4.5. I was
hoping we had gotten rid of those for good (cf. e.g. PR44065 and PR45674).


[Bug fortran/50227] [4.7 Regression] [OOP] ICE-on-valid with allocatable class variable

2011-08-29 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50227

--- Comment #11 from janus at gcc dot gnu.org 2011-08-29 19:28:42 UTC ---
Well, the obvious patch (based on Tobias' debugging) would be:


Index: gcc/fortran/trans-types.c
===
--- gcc/fortran/trans-types.c   (revision 178253)
+++ gcc/fortran/trans-types.c   (working copy)
@@ -2109,7 +2109,8 @@ gfc_sym_type (gfc_symbol * sym)
 {
   /* We must use pointer types for potentially absent variables.  The
 optimizers assume a reference type argument is never NULL.  */
-  if (sym->attr.optional || sym->ns->proc_name->attr.entry_master)
+  if (sym->attr.optional
+ || (sym->ns->proc_name && sym->ns->proc_name->attr.entry_master))
type = build_pointer_type (type);
   else
{


And indeed it seems to fix the segfault. However, I still don't really see the
connection to r171654.


[Bug fortran/50227] [4.7 Regression] [OOP] ICE-on-valid with allocatable class variable

2011-08-29 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50227

--- Comment #10 from janus at gcc dot gnu.org 2011-08-29 18:29:16 UTC ---
(In reply to comment #9)
> > > (r171654?).
> >
> > Rather not. This one only concerns type-bound procedures (of which Andrew's
> > test case has none):
> 
> Sorry to be such a nuisance, but it is: r171653 works, r171654 crashes.

Well, ok. If you say so :) Empirics beats intuition, I guess.

Also, you're not a nuisance at all. That's valuable information! Thanks for
checking ...


[Bug fortran/50227] [4.7 Regression] [OOP] ICE-on-valid with allocatable class variable

2011-08-29 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50227

--- Comment #9 from Dominique d'Humieres  2011-08-29 
18:17:50 UTC ---
> > (r171654?).
>
> Rather not. This one only concerns type-bound procedures (of which Andrew's
> test case has none):

Sorry to be such a nuisance, but it is: r171653 works, r171654 crashes.


[Bug fortran/50227] [4.7 Regression] [OOP] ICE-on-valid with allocatable class variable

2011-08-29 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50227

--- Comment #8 from Dominique d'Humieres  2011-08-29 
17:39:01 UTC ---
> Oops. Did I do this? Sorry, it was not intentional ...

Apparently this happens while changing the summary(?).


[Bug fortran/50227] [4.7 Regression] [OOP] ICE-on-valid with allocatable class variable

2011-08-29 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50227

janus at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1

--- Comment #7 from janus at gcc dot gnu.org 2011-08-29 17:36:29 UTC ---
(In reply to comment #6)
> Why setting this pr as unconfirmed?

Oops. Did I do this? Sorry, it was not intentional ...


[Bug fortran/50227] [4.7 Regression] [OOP] ICE-on-valid with allocatable class variable

2011-08-29 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50227

--- Comment #6 from Dominique d'Humieres  2011-08-29 
17:34:02 UTC ---
Why setting this pr as unconfirmed?


[Bug fortran/50227] [4.7 Regression] [OOP] ICE-on-valid with allocatable class variable

2011-08-29 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50227

janus at gcc dot gnu.org changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 Status|NEW |UNCONFIRMED
Summary|[4.7 Regression] [OOP] ICE  |[4.7 Regression] [OOP]
   |on valid with allocatable   |ICE-on-valid with
   |class component |allocatable class variable
 Ever Confirmed|1   |0