public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/50627] New: [OOP] Error recovery: ICE in gfc_free_namespace after properly diagnosing bogus SELECT TYPE in MODULE
@ 2011-10-06 9:59 burnus at gcc dot gnu.org
2011-10-06 10:48 ` [Bug fortran/50627] " janus at gcc dot gnu.org
` (11 more replies)
0 siblings, 12 replies; 13+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-10-06 9:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50627
Bug #: 50627
Summary: [OOP] Error recovery: ICE in gfc_free_namespace after
properly diagnosing bogus SELECT TYPE in MODULE
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: error-recovery, ice-on-invalid-code
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
The following bogus code is properly diagnosed but then once gets an ICE:
.... (some more error messages) ...
Error: Expecting END MODULE statement at (1)
f951: internal compiler error: in gfc_free_namespace, at fortran/symbol.c:3259
The result is the same for 4.6 and 4.7; 4.5 seems to enter an endless loop -
and 4.4 simply prints an error as it does not know CLASS or SELECT TYPE.
module m
type t
end type t
class(t), allocatable :: xx
select type(xx)
! type is(t)
! stop
end select
end
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/50627] [OOP] Error recovery: ICE in gfc_free_namespace after properly diagnosing bogus SELECT TYPE in MODULE
2011-10-06 9:59 [Bug fortran/50627] New: [OOP] Error recovery: ICE in gfc_free_namespace after properly diagnosing bogus SELECT TYPE in MODULE burnus at gcc dot gnu.org
@ 2011-10-06 10:48 ` janus at gcc dot gnu.org
2011-10-06 10:59 ` janus at gcc dot gnu.org
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: janus at gcc dot gnu.org @ 2011-10-06 10:48 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50627
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011-10-06
CC| |janus at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #1 from janus at gcc dot gnu.org 2011-10-06 10:47:59 UTC ---
(In reply to comment #0)
> f951: internal compiler error: in gfc_free_namespace, at fortran/symbol.c:3259
That line is:
gcc_assert (ns->refs == 0);
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/50627] [OOP] Error recovery: ICE in gfc_free_namespace after properly diagnosing bogus SELECT TYPE in MODULE
2011-10-06 9:59 [Bug fortran/50627] New: [OOP] Error recovery: ICE in gfc_free_namespace after properly diagnosing bogus SELECT TYPE in MODULE burnus at gcc dot gnu.org
2011-10-06 10:48 ` [Bug fortran/50627] " janus at gcc dot gnu.org
@ 2011-10-06 10:59 ` janus at gcc dot gnu.org
2011-10-09 18:13 ` [Bug fortran/50627] Error recovery: ICE in gfc_free_namespace after diagnosing missing end of construct tkoenig at gcc dot gnu.org
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: janus at gcc dot gnu.org @ 2011-10-06 10:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50627
--- Comment #2 from janus at gcc dot gnu.org 2011-10-06 10:58:57 UTC ---
(In reply to comment #1)
> > f951: internal compiler error: in gfc_free_namespace, at fortran/symbol.c:3259
>
> That line is:
>
> gcc_assert (ns->refs == 0);
... and the problem is that ns->refs is "-1", which probably means we free the
namespace twice ?!?
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/50627] Error recovery: ICE in gfc_free_namespace after diagnosing missing end of construct
2011-10-06 9:59 [Bug fortran/50627] New: [OOP] Error recovery: ICE in gfc_free_namespace after properly diagnosing bogus SELECT TYPE in MODULE burnus at gcc dot gnu.org
2011-10-06 10:48 ` [Bug fortran/50627] " janus at gcc dot gnu.org
2011-10-06 10:59 ` janus at gcc dot gnu.org
@ 2011-10-09 18:13 ` tkoenig at gcc dot gnu.org
2011-10-09 19:12 ` mikael at gcc dot gnu.org
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-10-09 18:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50627
Thomas Koenig <tkoenig at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tkoenig at gcc dot gnu.org
Summary|[OOP] Error recovery: ICE |Error recovery: ICE in
|in gfc_free_namespace after |gfc_free_namespace after
|properly diagnosing bogus |diagnosing missing end of
|SELECT TYPE in MODULE |construct
--- Comment #3 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-10-09 18:12:31 UTC ---
Simpler test case:
ig25@linux-fd1f:~/Krempel/OMP> cat block.f90
program main
block
end program main
ig25@linux-fd1f:~/Krempel/OMP> gfortran block.f90
block.f90:3.3:
end program main
1
Error: Expecting END BLOCK statement at (1)
Error: Unexpected end of file in 'block.f90'
f951: internal compiler error: in gfc_free_namespace, at fortran/symbol.c:3259
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/50627] Error recovery: ICE in gfc_free_namespace after diagnosing missing end of construct
2011-10-06 9:59 [Bug fortran/50627] New: [OOP] Error recovery: ICE in gfc_free_namespace after properly diagnosing bogus SELECT TYPE in MODULE burnus at gcc dot gnu.org
` (2 preceding siblings ...)
2011-10-09 18:13 ` [Bug fortran/50627] Error recovery: ICE in gfc_free_namespace after diagnosing missing end of construct tkoenig at gcc dot gnu.org
@ 2011-10-09 19:12 ` mikael at gcc dot gnu.org
2013-01-20 18:08 ` Joost.VandeVondele at mat dot ethz.ch
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: mikael at gcc dot gnu.org @ 2011-10-09 19:12 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50627
Mikael Morin <mikael at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mikael at gcc dot gnu.org
--- Comment #4 from Mikael Morin <mikael at gcc dot gnu.org> 2011-10-09 19:11:14 UTC ---
For the problem in comment #0:
As we parse select type, we create a new namespace.
The statement is (correctly) rejected, but we don't free the namespace.
Then we are back parsing module content, and the code doing that assumes that
gfc_current_namespace points to the module namespace, which is not the case
anymore (it points to the select namespace).
I assume that the problem in comment #3 is of the same kind:
We parse some block content, encounter end of file, then are back at parsing
the main program unit with gfc_current_ns still pointing to the block
namespace.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/50627] Error recovery: ICE in gfc_free_namespace after diagnosing missing end of construct
2011-10-06 9:59 [Bug fortran/50627] New: [OOP] Error recovery: ICE in gfc_free_namespace after properly diagnosing bogus SELECT TYPE in MODULE burnus at gcc dot gnu.org
` (3 preceding siblings ...)
2011-10-09 19:12 ` mikael at gcc dot gnu.org
@ 2013-01-20 18:08 ` Joost.VandeVondele at mat dot ethz.ch
2013-01-20 18:10 ` [Bug fortran/50627] [4.6/4.7/4.8 Regression] " Joost.VandeVondele at mat dot ethz.ch
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Joost.VandeVondele at mat dot ethz.ch @ 2013-01-20 18:08 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50627
Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> changed:
What |Removed |Added
----------------------------------------------------------------------------
Blocks| |56054
CC| |Joost.VandeVondele at mat
| |dot ethz.ch
--- Comment #5 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> 2013-01-20 18:08:20 UTC ---
*** Bug 56054 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/50627] [4.6/4.7/4.8 Regression] Error recovery: ICE in gfc_free_namespace after diagnosing missing end of construct
2011-10-06 9:59 [Bug fortran/50627] New: [OOP] Error recovery: ICE in gfc_free_namespace after properly diagnosing bogus SELECT TYPE in MODULE burnus at gcc dot gnu.org
` (4 preceding siblings ...)
2013-01-20 18:08 ` Joost.VandeVondele at mat dot ethz.ch
@ 2013-01-20 18:10 ` Joost.VandeVondele at mat dot ethz.ch
2013-01-27 13:35 ` tkoenig at gcc dot gnu.org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Joost.VandeVondele at mat dot ethz.ch @ 2013-01-20 18:10 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50627
Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|Error recovery: ICE in |[4.6/4.7/4.8 Regression]
|gfc_free_namespace after |Error recovery: ICE in
|diagnosing missing end of |gfc_free_namespace after
|construct |diagnosing missing end of
| |construct
--- Comment #6 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> 2013-01-20 18:10:09 UTC ---
The testcase in PR56054 shows the ICE is a regression wrt to 4.5
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/50627] [4.6/4.7/4.8 Regression] Error recovery: ICE in gfc_free_namespace after diagnosing missing end of construct
2011-10-06 9:59 [Bug fortran/50627] New: [OOP] Error recovery: ICE in gfc_free_namespace after properly diagnosing bogus SELECT TYPE in MODULE burnus at gcc dot gnu.org
` (5 preceding siblings ...)
2013-01-20 18:10 ` [Bug fortran/50627] [4.6/4.7/4.8 Regression] " Joost.VandeVondele at mat dot ethz.ch
@ 2013-01-27 13:35 ` tkoenig at gcc dot gnu.org
2013-02-02 9:51 ` tkoenig at gcc dot gnu.org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2013-01-27 13:35 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50627
Thomas Koenig <tkoenig at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |tkoenig at gcc dot gnu.org
|gnu.org |
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/50627] [4.6/4.7/4.8 Regression] Error recovery: ICE in gfc_free_namespace after diagnosing missing end of construct
2011-10-06 9:59 [Bug fortran/50627] New: [OOP] Error recovery: ICE in gfc_free_namespace after properly diagnosing bogus SELECT TYPE in MODULE burnus at gcc dot gnu.org
` (6 preceding siblings ...)
2013-01-27 13:35 ` tkoenig at gcc dot gnu.org
@ 2013-02-02 9:51 ` tkoenig at gcc dot gnu.org
2013-02-02 9:52 ` [Bug fortran/50627] [4.6/4.7 " tkoenig at gcc dot gnu.org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2013-02-02 9:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50627
--- Comment #7 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2013-02-02 09:51:03 UTC ---
Author: tkoenig
Date: Sat Feb 2 09:50:58 2013
New Revision: 195684
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195684
Log:
2013-02-02 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/50627
PR fortran/56054
* decl.c (gfc_match_end): Remove half-ready namespace
from parent if the end of a block is missing.
* parse.c (parse_module): Do not put namespace into
gsymbol on error.
2013-02-02 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/50627
PR fortran/56054
* gfortran.dg/block_12.f90: New test.
* gfortran.dg/module_error_1.f90: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/block_12.f90
trunk/gcc/testsuite/gfortran.dg/module_error_1.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/decl.c
trunk/gcc/fortran/parse.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/50627] [4.6/4.7 Regression] Error recovery: ICE in gfc_free_namespace after diagnosing missing end of construct
2011-10-06 9:59 [Bug fortran/50627] New: [OOP] Error recovery: ICE in gfc_free_namespace after properly diagnosing bogus SELECT TYPE in MODULE burnus at gcc dot gnu.org
` (7 preceding siblings ...)
2013-02-02 9:51 ` tkoenig at gcc dot gnu.org
@ 2013-02-02 9:52 ` tkoenig at gcc dot gnu.org
2013-02-02 22:38 ` tkoenig at gcc dot gnu.org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2013-02-02 9:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50627
Thomas Koenig <tkoenig at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.7.3
Summary|[4.6/4.7/4.8 Regression] |[4.6/4.7 Regression] Error
|Error recovery: ICE in |recovery: ICE in
|gfc_free_namespace after |gfc_free_namespace after
|diagnosing missing end of |diagnosing missing end of
|construct |construct
--- Comment #8 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2013-02-02 09:52:38 UTC ---
Fixed on trunk so far.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/50627] [4.6/4.7 Regression] Error recovery: ICE in gfc_free_namespace after diagnosing missing end of construct
2011-10-06 9:59 [Bug fortran/50627] New: [OOP] Error recovery: ICE in gfc_free_namespace after properly diagnosing bogus SELECT TYPE in MODULE burnus at gcc dot gnu.org
` (8 preceding siblings ...)
2013-02-02 9:52 ` [Bug fortran/50627] [4.6/4.7 " tkoenig at gcc dot gnu.org
@ 2013-02-02 22:38 ` tkoenig at gcc dot gnu.org
2013-02-03 13:15 ` tkoenig at gcc dot gnu.org
2013-02-03 13:16 ` tkoenig at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2013-02-02 22:38 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50627
--- Comment #9 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2013-02-02 22:38:22 UTC ---
Author: tkoenig
Date: Sat Feb 2 22:38:14 2013
New Revision: 195687
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195687
Log:
2013-02-02 Thomas Koenig <tkoenig@gcc.gnu.org>
Backport from trunk
PR fortran/50627
PR fortran/56054
* decl.c (gfc_match_end): Remove half-ready namespace
from parent if the end of a block is missing.
* parse.c (parse_module): Do not put namespace into
gsymbol on error.
2013-02-02 Thomas Koenig <tkoenig@gcc.gnu.org>
Backport from trunk
PR fortran/50627
PR fortran/56054
* gfortran.dg/block_12.f90: New test.
* gfortran.dg/module_error_1.f90: New test.
Added:
branches/gcc-4_7-branch/gcc/testsuite/gfortran.dg/block_12.f90
branches/gcc-4_7-branch/gcc/testsuite/gfortran.dg/module_error_1.f90
Modified:
branches/gcc-4_7-branch/gcc/fortran/ChangeLog
branches/gcc-4_7-branch/gcc/fortran/decl.c
branches/gcc-4_7-branch/gcc/fortran/parse.c
branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/50627] [4.6/4.7 Regression] Error recovery: ICE in gfc_free_namespace after diagnosing missing end of construct
2011-10-06 9:59 [Bug fortran/50627] New: [OOP] Error recovery: ICE in gfc_free_namespace after properly diagnosing bogus SELECT TYPE in MODULE burnus at gcc dot gnu.org
` (9 preceding siblings ...)
2013-02-02 22:38 ` tkoenig at gcc dot gnu.org
@ 2013-02-03 13:15 ` tkoenig at gcc dot gnu.org
2013-02-03 13:16 ` tkoenig at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2013-02-03 13:15 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50627
--- Comment #10 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2013-02-03 13:15:24 UTC ---
Author: tkoenig
Date: Sun Feb 3 13:15:18 2013
New Revision: 195695
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195695
Log:
2013-02-03 Thomas Koenig <tkoenig@gcc.gnu.org>
Backport from trunk
PR fortran/50627
PR fortran/56054
* decl.c (gfc_match_end): Remove half-ready namespace
from parent if the end of a block is missing.
* parse.c (parse_module): Do not put namespace into
gsymbol on error.
2013-02-03 Thomas Koenig <tkoenig@gcc.gnu.org>
Backport from trunk
PR fortran/50627
PR fortran/56054
* gfortran.dg/block_12.f90: New test.
* gfortran.dg/module_error_1.f90: New test.
Added:
branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/block_12.f90
branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/module_error_1.f90
Modified:
branches/gcc-4_6-branch/gcc/fortran/ChangeLog
branches/gcc-4_6-branch/gcc/fortran/decl.c
branches/gcc-4_6-branch/gcc/fortran/parse.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/50627] [4.6/4.7 Regression] Error recovery: ICE in gfc_free_namespace after diagnosing missing end of construct
2011-10-06 9:59 [Bug fortran/50627] New: [OOP] Error recovery: ICE in gfc_free_namespace after properly diagnosing bogus SELECT TYPE in MODULE burnus at gcc dot gnu.org
` (10 preceding siblings ...)
2013-02-03 13:15 ` tkoenig at gcc dot gnu.org
@ 2013-02-03 13:16 ` tkoenig at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2013-02-03 13:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50627
Thomas Koenig <tkoenig at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #11 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2013-02-03 13:16:30 UTC ---
Fixed on all affected and supported branches, closing.
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2013-02-03 13:16 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-06 9:59 [Bug fortran/50627] New: [OOP] Error recovery: ICE in gfc_free_namespace after properly diagnosing bogus SELECT TYPE in MODULE burnus at gcc dot gnu.org
2011-10-06 10:48 ` [Bug fortran/50627] " janus at gcc dot gnu.org
2011-10-06 10:59 ` janus at gcc dot gnu.org
2011-10-09 18:13 ` [Bug fortran/50627] Error recovery: ICE in gfc_free_namespace after diagnosing missing end of construct tkoenig at gcc dot gnu.org
2011-10-09 19:12 ` mikael at gcc dot gnu.org
2013-01-20 18:08 ` Joost.VandeVondele at mat dot ethz.ch
2013-01-20 18:10 ` [Bug fortran/50627] [4.6/4.7/4.8 Regression] " Joost.VandeVondele at mat dot ethz.ch
2013-01-27 13:35 ` tkoenig at gcc dot gnu.org
2013-02-02 9:51 ` tkoenig at gcc dot gnu.org
2013-02-02 9:52 ` [Bug fortran/50627] [4.6/4.7 " tkoenig at gcc dot gnu.org
2013-02-02 22:38 ` tkoenig at gcc dot gnu.org
2013-02-03 13:15 ` tkoenig at gcc dot gnu.org
2013-02-03 13:16 ` tkoenig at gcc dot gnu.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).