public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/59440] New: [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g
@ 2013-12-09 23:03 anlauf at gmx dot de
2013-12-10 12:03 ` [Bug fortran/59440] " rguenth at gcc dot gnu.org
` (13 more replies)
0 siblings, 14 replies; 15+ messages in thread
From: anlauf at gmx dot de @ 2013-12-09 23:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59440
Bug ID: 59440
Summary: [4.9 Regression] ICE in force_decl_die, at
dwarf2out.c:20111 with -g
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: anlauf at gmx dot de
Hi,
with 4.9.0 rev.205822 the following code crashes with:
gfcbug126.f90:2:0: internal compiler error: in force_decl_die, at
dwarf2out.c:20111
use mo_t_datum, only: qbit_conv
^
0x83eae74 force_decl_die
../../trunk/gcc/dwarf2out.c:20111
0x83eb3be gen_namelist_decl
../../trunk/gcc/dwarf2out.c:20632
0x83e9087 gen_decl_die
../../trunk/gcc/dwarf2out.c:20435
0x86d0e80 emit_debug_global_declarations(tree_node**, int)
../../trunk/gcc/toplev.c:532
0x858faee write_global_declarations()
../../trunk/gcc/langhooks.c:327
% cat mo_t_datum.f90
module mo_t_datum
implicit none
integer :: qbit_conv = 0
end module mo_t_datum
% cat gfcbug126.f90
MODULE gfcbug126
use mo_t_datum, only: qbit_conv
implicit none
namelist /OBSERVATIONS/ qbit_conv
end module gfcbug126
Command line:
% /opt/gcc/4.9/bin/gfortran -c mo_t_datum.f90 gfcbug126.f90 -g
It is important that the code is split into 2 files, otherwise there is
no crash.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/59440] [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g
2013-12-09 23:03 [Bug fortran/59440] New: [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g anlauf at gmx dot de
@ 2013-12-10 12:03 ` rguenth at gcc dot gnu.org
2013-12-11 15:05 ` janus at gcc dot gnu.org
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-10 12:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59440
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.9.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/59440] [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g
2013-12-09 23:03 [Bug fortran/59440] New: [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g anlauf at gmx dot de
2013-12-10 12:03 ` [Bug fortran/59440] " rguenth at gcc dot gnu.org
@ 2013-12-11 15:05 ` janus at gcc dot gnu.org
2013-12-11 22:29 ` burnus at gcc dot gnu.org
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: janus at gcc dot gnu.org @ 2013-12-11 15:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59440
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-12-11
CC| |janus at gcc dot gnu.org
Ever confirmed|0 |1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/59440] [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g
2013-12-09 23:03 [Bug fortran/59440] New: [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g anlauf at gmx dot de
2013-12-10 12:03 ` [Bug fortran/59440] " rguenth at gcc dot gnu.org
2013-12-11 15:05 ` janus at gcc dot gnu.org
@ 2013-12-11 22:29 ` burnus at gcc dot gnu.org
2013-12-11 22:52 ` janus at gcc dot gnu.org
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-12-11 22:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59440
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |burnus at gcc dot gnu.org
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Confirmed - also occurs when the namelist is in a procedure - and the problem
is independent whether it is USE associated with and without ONLY.
Lightly tested draft patch:
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -4164,6 +4164,7 @@ generate_namelist_decl (gfc_symbol * sym)
nml->sym->attr.referenced = 1;
nml->sym->backend_decl = gfc_get_symbol_decl (nml->sym);
}
+ DECL_IGNORED_P (nml->sym->backend_decl) = 0;
CONSTRUCTOR_APPEND_ELT (nml_decls, NULL_TREE, nml->sym->backend_decl);
}
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/59440] [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g
2013-12-09 23:03 [Bug fortran/59440] New: [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g anlauf at gmx dot de
` (2 preceding siblings ...)
2013-12-11 22:29 ` burnus at gcc dot gnu.org
@ 2013-12-11 22:52 ` janus at gcc dot gnu.org
2013-12-12 19:59 ` burnus at gcc dot gnu.org
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: janus at gcc dot gnu.org @ 2013-12-11 22:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59440
--- Comment #3 from janus at gcc dot gnu.org ---
(In reply to Tobias Burnus from comment #2)
> Lightly tested draft patch:
Fixes all occurrences of the problem for one of my larger codes (which has tons
of namelists).
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/59440] [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g
2013-12-09 23:03 [Bug fortran/59440] New: [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g anlauf at gmx dot de
` (3 preceding siblings ...)
2013-12-11 22:52 ` janus at gcc dot gnu.org
@ 2013-12-12 19:59 ` burnus at gcc dot gnu.org
2013-12-12 22:30 ` anlauf at gmx dot de
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-12-12 19:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59440
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> ---
FIXED!
Thanks for the report and quick feedback!
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/59440] [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g
2013-12-09 23:03 [Bug fortran/59440] New: [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g anlauf at gmx dot de
` (4 preceding siblings ...)
2013-12-12 19:59 ` burnus at gcc dot gnu.org
@ 2013-12-12 22:30 ` anlauf at gmx dot de
2013-12-13 7:26 ` burnus at gcc dot gnu.org
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: anlauf at gmx dot de @ 2013-12-12 22:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59440
Harald Anlauf <anlauf at gmx dot de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |---
--- Comment #6 from Harald Anlauf <anlauf at gmx dot de> ---
(In reply to Tobias Burnus from comment #5)
> FIXED!
>
> Thanks for the report and quick feedback!
Tobias,
here's another case where it crashes again:
% cat gfcbug127.f90
module gfcbug127
implicit none
type t
integer :: grid = 0
end type t
contains
subroutine read_nml (nnml, s)
integer, intent(in) :: nnml
type(t), intent(out) :: s
integer :: grid
call read_nml_type_2
s% grid = grid
contains
subroutine read_nml_type_2
namelist /N/ grid
read (nnml, nml=N)
end subroutine read_nml_type_2
end subroutine read_nml
end module gfcbug127
% /opt/gcc/4.9/bin/gfortran -c gfcbug127.f90 -g
gfcbug127.f90: In function 'read_nml_type_2':
gfcbug127.f90:17:0: internal compiler error: in force_decl_die, at
dwarf2out.c:20111
end subroutine read_nml_type_2
^
0x83eb334 force_decl_die
../../trunk/gcc/dwarf2out.c:20111
0x83eb87e gen_namelist_decl
../../trunk/gcc/dwarf2out.c:20632
0x83e9547 gen_decl_die
../../trunk/gcc/dwarf2out.c:20435
0x83fd4b5 decls_for_scope
../../trunk/gcc/dwarf2out.c:19969
0x83e31dc gen_subprogram_die
../../trunk/gcc/dwarf2out.c:18354
0x83e9b99 gen_decl_die
../../trunk/gcc/dwarf2out.c:20336
0x83eb0ce dwarf2out_function_decl
../../trunk/gcc/dwarf2out.c:20776
0x8454f92 rest_of_handle_final
../../trunk/gcc/final.c:4469
0x8454f92 execute
../../trunk/gcc/final.c:4513
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/59440] [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g
2013-12-09 23:03 [Bug fortran/59440] New: [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g anlauf at gmx dot de
` (5 preceding siblings ...)
2013-12-12 22:30 ` anlauf at gmx dot de
@ 2013-12-13 7:26 ` burnus at gcc dot gnu.org
2013-12-18 22:01 ` burnus at gcc dot gnu.org
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-12-13 7:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59440
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |openmp
--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Also the following variant fails, where the NAMELIST and the "grid" variable
are in the same subroutine - and only the NML read is in the internal
subroutine.
module gfcbug127
implicit none
type t
integer :: grid = 0
end type t
contains
subroutine read_nml (nnml, s)
integer, intent(in) :: nnml
type(t), intent(out) :: s
integer :: grid
namelist /N/ grid
call read_nml_type_2
s%grid = grid
contains
subroutine read_nml_type_2
read (nnml, nml=N)
end subroutine read_nml_type_2
end subroutine read_nml
end module gfcbug127
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/59440] [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g
2013-12-09 23:03 [Bug fortran/59440] New: [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g anlauf at gmx dot de
` (6 preceding siblings ...)
2013-12-13 7:26 ` burnus at gcc dot gnu.org
@ 2013-12-18 22:01 ` burnus at gcc dot gnu.org
2013-12-18 22:34 ` burnus at gcc dot gnu.org
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-12-18 22:01 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59440
--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> ---
The problem is the following code in tree-nested.c:
/* A subroutine of convert_local_reference. Create a local variable
in the parent function with DECL_VALUE_EXPR set to reference the
field in FRAME. This is used both for debug info and in OpenMP
lowering. */
static tree
get_local_debug_decl (struct nesting_info *info, tree decl, tree field)
{
...
new_decl = build_decl (DECL_SOURCE_LOCATION (decl),
VAR_DECL, DECL_NAME (decl), TREE_TYPE (decl));
DECL_IGNORED_P (new_decl) = DECL_IGNORED_P (decl);
...
/* Do not emit debug info twice. */
DECL_IGNORED_P (decl) = 1;
}
Result: new_decl gets emitted due to DECL_IGNORED_P being copied - but the
NAMELIST_DECL still points to the 'old' decl, which now has DECL_IGNORED_P() =
1.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/59440] [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g
2013-12-09 23:03 [Bug fortran/59440] New: [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g anlauf at gmx dot de
` (7 preceding siblings ...)
2013-12-18 22:01 ` burnus at gcc dot gnu.org
@ 2013-12-18 22:34 ` burnus at gcc dot gnu.org
2013-12-19 15:40 ` rguenth at gcc dot gnu.org
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-12-18 22:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59440
--- Comment #9 from Tobias Burnus <burnus at gcc dot gnu.org> ---
I see two not so pretty solutions:
a) The simple way: Duplicate debug info by also emitting code for the original
DECL.
b) The hard & slow way:
In tree-nested.c, add another walk_tree(), to be run after walk_function(),
which searches for TREE_CODE() == NAMELIST_DECL.
Then, the easy part follows: Go through the VEC of the NAMELIST_DECL and
replace the original decl by the one returned by
pointer_map_contains(info->var_map, decl).
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/59440] [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g
2013-12-09 23:03 [Bug fortran/59440] New: [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g anlauf at gmx dot de
` (8 preceding siblings ...)
2013-12-18 22:34 ` burnus at gcc dot gnu.org
@ 2013-12-19 15:40 ` rguenth at gcc dot gnu.org
2014-01-17 9:24 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-19 15:40 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59440
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/59440] [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g
2013-12-09 23:03 [Bug fortran/59440] New: [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g anlauf at gmx dot de
` (9 preceding siblings ...)
2013-12-19 15:40 ` rguenth at gcc dot gnu.org
@ 2014-01-17 9:24 ` jakub at gcc dot gnu.org
2014-01-17 14:43 ` jakub at gcc dot gnu.org
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-01-17 9:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59440
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 31867
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31867&action=edit
gcc49-pr59440.patch
Untested fix.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/59440] [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g
2013-12-09 23:03 [Bug fortran/59440] New: [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g anlauf at gmx dot de
` (10 preceding siblings ...)
2014-01-17 9:24 ` jakub at gcc dot gnu.org
@ 2014-01-17 14:43 ` jakub at gcc dot gnu.org
2014-01-17 14:54 ` jakub at gcc dot gnu.org
2014-01-17 19:52 ` jakub at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-01-17 14:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59440
--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Fri Jan 17 14:42:58 2014
New Revision: 206711
URL: http://gcc.gnu.org/viewcvs?rev=206711&root=gcc&view=rev
Log:
PR fortran/59440
* tree-nested.c (convert_nonlocal_reference_stmt,
convert_local_reference_stmt): For NAMELIST_DECLs in gimple_bind_vars
of GIMPLE_BIND stmts, adjust associated decls.
* gfortran.dg/pr59440-1.f90: New test.
* gfortran.dg/pr59440-2.f90: New test.
* gfortran.dg/pr59440-3.f90: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/pr59440-1.f90
trunk/gcc/testsuite/gfortran.dg/pr59440-2.f90
trunk/gcc/testsuite/gfortran.dg/pr59440-3.f90
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-nested.c
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/59440] [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g
2013-12-09 23:03 [Bug fortran/59440] New: [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g anlauf at gmx dot de
` (11 preceding siblings ...)
2014-01-17 14:43 ` jakub at gcc dot gnu.org
@ 2014-01-17 14:54 ` jakub at gcc dot gnu.org
2014-01-17 19:52 ` jakub at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-01-17 14:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59440
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution|--- |FIXED
--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug fortran/59440] [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g
2013-12-09 23:03 [Bug fortran/59440] New: [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g anlauf at gmx dot de
` (12 preceding siblings ...)
2014-01-17 14:54 ` jakub at gcc dot gnu.org
@ 2014-01-17 19:52 ` jakub at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-01-17 19:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59440
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mrestelli at gmail dot com
--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
*** Bug 59806 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2014-01-17 19:52 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-09 23:03 [Bug fortran/59440] New: [4.9 Regression] ICE in force_decl_die, at dwarf2out.c:20111 with -g anlauf at gmx dot de
2013-12-10 12:03 ` [Bug fortran/59440] " rguenth at gcc dot gnu.org
2013-12-11 15:05 ` janus at gcc dot gnu.org
2013-12-11 22:29 ` burnus at gcc dot gnu.org
2013-12-11 22:52 ` janus at gcc dot gnu.org
2013-12-12 19:59 ` burnus at gcc dot gnu.org
2013-12-12 22:30 ` anlauf at gmx dot de
2013-12-13 7:26 ` burnus at gcc dot gnu.org
2013-12-18 22:01 ` burnus at gcc dot gnu.org
2013-12-18 22:34 ` burnus at gcc dot gnu.org
2013-12-19 15:40 ` rguenth at gcc dot gnu.org
2014-01-17 9:24 ` jakub at gcc dot gnu.org
2014-01-17 14:43 ` jakub at gcc dot gnu.org
2014-01-17 14:54 ` jakub at gcc dot gnu.org
2014-01-17 19:52 ` jakub 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).