[Bug fortran/45797] ICE (segfault): Invalid read in gfc_use_derived
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45797 Mikael Morin mikael at gcc dot gnu.org changed: What|Removed |Added Status|NEW |RESOLVED Known to work||4.7.2, 4.8.0 Resolution||FIXED --- Comment #5 from Mikael Morin mikael at gcc dot gnu.org 2013-01-04 13:24:29 UTC --- This has been fixed.
[Bug fortran/45797] ICE (segfault): Invalid read in gfc_use_derived
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45797 --- Comment #4 from Mikael Morin mikael at gcc dot gnu.org 2011-03-04 23:49:27 UTC --- (In reply to comment #3) The patch in comment #2 fixes the ICE, but yields several more errors: Yes, because without the patch gfortran was killed before finishing parsing (and throwing more errors).
[Bug fortran/45797] ICE (segfault): Invalid read in gfc_use_derived
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45797 Dominique d'Humieres dominiq at lps dot ens.fr changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2011.03.01 15:57:58 Ever Confirmed|0 |1 --- Comment #3 from Dominique d'Humieres dominiq at lps dot ens.fr 2011-03-01 15:57:58 UTC --- The patch in comment #2 fixes the ICE, but yields several more errors: [macbook] f90/bug% gfc pr45797.f90 pr45797.f90:10.10: type foo 1 Error: PROCEDURE attribute of 'foo' conflicts with DERIVED attribute at (1) pr45797.f90:12.5: end type 1 Error: Expecting END MODULE statement at (1) pr45797.f90:14.11: type(foo) function constructor() 1 Error: PROCEDURE attribute of 'foo' conflicts with DERIVED attribute at (1) pr45797.f90:15.4: constructor%bar = 1 1 Error: Unclassifiable statement at (1) pr45797.f90:14.2: type(foo) function constructor() 1 Error: The type for function 'constructor' at (1) is not accessible pr45797.f90:19.13: type(foo) :: f 1 Error: PROCEDURE attribute of 'foo' conflicts with DERIVED attribute at (1) pr45797.f90:21.9: if (f%bar /= 1) call abort () 1 Error: Syntax error in IF-expression at (1) pr45797.f90:23.9: if (f%bar /= 2) call abort () 1 Error: Syntax error in IF-expression at (1) pr45797.f90:25.9: if (f%bar /= 22) call abort () 1 Error: Syntax error in IF-expression at (1) pr45797.f90:22.8: f = foo(2) 1 Error: There is no specific function for the generic 'foo' at (1) pr45797.f90:24.8: f = foo(bar=22) 1 Error: There is no specific function for the generic 'foo' at (1) pr45797.f90:37.15: interface bar 1 Error: DERIVED attribute of 'bar' conflicts with PROCEDURE attribute at (1) pr45797.f90:38.4: procedure constructor 1 Error: Unclassifiable statement at (1) pr45797.f90:39.5: end interface 1 Error: Expecting END MODULE statement at (1) pr45797.f90:57.16: use foo_module 1 Fatal Error: Can't open module file 'foo_module.mod' for reading at (1): No such file or directory compared to pr45797.f90:10.10: type foo 1 Error: PROCEDURE attribute of 'foo' conflicts with DERIVED attribute at (1) pr45797.f90:12.5: end type 1 Error: Expecting END MODULE statement at (1) pr45797.f90:14.11: type(foo) function constructor() 1 Error: PROCEDURE attribute of 'foo' conflicts with DERIVED attribute at (1) f951: internal compiler error: Segmentation fault
[Bug fortran/45797] ICE (segfault): Invalid read in gfc_use_derived
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45797 Mikael Morin mikael at gcc dot gnu.org changed: What|Removed |Added Keywords||patch CC||mikael at gcc dot gnu.org --- Comment #2 from Mikael Morin mikael at gcc dot gnu.org 2011-02-18 21:26:55 UTC --- quick fix diff --git a/symbol.c b/symbol.c index 71aa518..ac274d6 100644 --- a/symbol.c +++ b/symbol.c @@ -1939,6 +1939,10 @@ gfc_use_derived (gfc_symbol *sym) gfc_symtree *st; int i; + /* Something went bad earlier, bail out. */ + if (sym == NULL) +return NULL; + if (sym-components != NULL || sym-attr.zero_comp) return sym; /* Already defined. */