public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/23547] New: [4.1 regression] ICE with recursive call to nested function
@ 2005-08-24 16:15 reichelt at gcc dot gnu dot org
2005-08-24 16:17 ` [Bug c/23547] " reichelt at gcc dot gnu dot org
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-08-24 16:15 UTC (permalink / raw)
To: gcc-bugs
The following valid code snippet causes an ICE on mainline when compiled
with "--param ggc-min-expand=0 --param ggc-min-heapsize=0":
==================
void foo()
{
void bar()
{
bar();
}
}
==================
Apparently there's something wrong with recursive calls to nested functions.
--
Summary: [4.1 regression] ICE with recursive call to nested
function
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code, monitored
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23547
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/23547] [4.1 regression] ICE with recursive call to nested function
2005-08-24 16:15 [Bug c/23547] New: [4.1 regression] ICE with recursive call to nested function reichelt at gcc dot gnu dot org
@ 2005-08-24 16:17 ` reichelt at gcc dot gnu dot org
2005-08-24 16:39 ` pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-08-24 16:17 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2005-08-24 16:14 -------
Btw, the error message is:
bug.c:7: internal compiler error: in layout_decl, at stor-layout.c:302
Please submit a full bug report, [etc.]
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23547
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/23547] [4.1 regression] ICE with recursive call to nested function
2005-08-24 16:15 [Bug c/23547] New: [4.1 regression] ICE with recursive call to nested function reichelt at gcc dot gnu dot org
2005-08-24 16:17 ` [Bug c/23547] " reichelt at gcc dot gnu dot org
@ 2005-08-24 16:39 ` pinskia at gcc dot gnu dot org
2005-08-24 16:55 ` [Bug middle-end/23547] [4.1 regression] [non-unit-at-a-time] " pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-24 16:39 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-24 16:35 -------
This fails in 20050622 too but works in 20050321.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Known to fail| |4.1.0
Known to work| |4.0.0
Last reconfirmed|0000-00-00 00:00:00 |2005-08-24 16:35:38
date| |
Target Milestone|--- |4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23547
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug middle-end/23547] [4.1 regression] [non-unit-at-a-time] ICE with recursive call to nested function
2005-08-24 16:15 [Bug c/23547] New: [4.1 regression] ICE with recursive call to nested function reichelt at gcc dot gnu dot org
2005-08-24 16:17 ` [Bug c/23547] " reichelt at gcc dot gnu dot org
2005-08-24 16:39 ` pinskia at gcc dot gnu dot org
@ 2005-08-24 16:55 ` pinskia at gcc dot gnu dot org
2005-08-25 16:43 ` reichelt at gcc dot gnu dot org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-24 16:55 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-24 16:46 -------
This is definitely a GC issue and a middle-end issue.
#0 internal_error (gmsgid=0x8edd74 "in %s, at %s:%d") at /Users/pinskia/src/alias/gcc/gcc/
diagnostic.c:534
#1 0x002e6e00 in fancy_abort (file=0x8e9c4c "/Users/pinskia/src/alias/gcc/gcc/stor-layout.c",
line=302, function=0x8e9d2c "layout_decl") at /Users/pinskia/src/alias/gcc/gcc/diagnostic.c:590
#2 0x0023e280 in layout_decl (decl=0x41c23360, known_align=0) at /Users/pinskia/src/alias/gcc/
gcc/stor-layout.c:302
#3 0x0028fe38 in finalize_nesting_tree_1 (root=0x41b00390) at /Users/pinskia/src/alias/gcc/gcc/
tree-nested.c:1337
#4 0x002906d4 in finalize_nesting_tree (root=0x41b00390) at /Users/pinskia/src/alias/gcc/gcc/tree-
nested.c:1459
#5 0x00290820 in lower_nested_functions (fndecl=0x41c14080) at /Users/pinskia/src/alias/gcc/gcc/
tree-nested.c:1503
#6 0x003026b8 in cgraph_finalize_function (decl=0x41c14080, nested=0 '\0') at /Users/pinskia/src/
alias/gcc/gcc/cgraphunit.c:423
#7 0x00028224 in finish_function () at /Users/pinskia/src/alias/gcc/gcc/c-decl.c:6602
#8 0x000b1ab0 in c_parser_declaration_or_fndef (parser=0x41c0f090, fndef_ok=1 '\001',
empty_ok=1 '\001', nested=0 '\0', start_attr_ok=1 '\001') at /Users/pinskia/src/alias/gcc/gcc/c-
parser.c:1307
This is a non unit-at-a-time issue.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org, hubicka at gcc dot gnu
| |dot org
Component|c |middle-end
Summary|[4.1 regression] ICE with |[4.1 regression] [non-unit-
|recursive call to nested |at-a-time] ICE with
|function |recursive call to nested
| |function
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23547
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug middle-end/23547] [4.1 regression] [non-unit-at-a-time] ICE with recursive call to nested function
2005-08-24 16:15 [Bug c/23547] New: [4.1 regression] ICE with recursive call to nested function reichelt at gcc dot gnu dot org
` (2 preceding siblings ...)
2005-08-24 16:55 ` [Bug middle-end/23547] [4.1 regression] [non-unit-at-a-time] " pinskia at gcc dot gnu dot org
@ 2005-08-25 16:43 ` reichelt at gcc dot gnu dot org
2005-08-28 3:05 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-08-25 16:43 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2005-08-25 16:41 -------
Here's another testcase (no recursion, but with nested functions):
================================
void foo(int i)
{
void bar (char c[1][i]) { }
}
================================
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23547
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug middle-end/23547] [4.1 regression] [non-unit-at-a-time] ICE with recursive call to nested function
2005-08-24 16:15 [Bug c/23547] New: [4.1 regression] ICE with recursive call to nested function reichelt at gcc dot gnu dot org
` (3 preceding siblings ...)
2005-08-25 16:43 ` reichelt at gcc dot gnu dot org
@ 2005-08-28 3:05 ` pinskia at gcc dot gnu dot org
2005-08-28 3:14 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-28 3:05 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |critical
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23547
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug middle-end/23547] [4.1 regression] [non-unit-at-a-time] ICE with recursive call to nested function
2005-08-24 16:15 [Bug c/23547] New: [4.1 regression] ICE with recursive call to nested function reichelt at gcc dot gnu dot org
` (4 preceding siblings ...)
2005-08-28 3:05 ` pinskia at gcc dot gnu dot org
@ 2005-08-28 3:14 ` pinskia at gcc dot gnu dot org
2005-08-28 3:36 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-28 3:14 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-28 03:12 -------
The problem is that nesting_info is not marked as GTY and we call cgraph_finalize_function which
lowers the function which calls ggc_collect. I think marking nesting_info (and root) as GTY will fix the
problem. I will look into a patch.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pinskia at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23547
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug middle-end/23547] [4.1 regression] [non-unit-at-a-time] ICE with recursive call to nested function
2005-08-24 16:15 [Bug c/23547] New: [4.1 regression] ICE with recursive call to nested function reichelt at gcc dot gnu dot org
` (5 preceding siblings ...)
2005-08-28 3:14 ` pinskia at gcc dot gnu dot org
@ 2005-08-28 3:36 ` pinskia at gcc dot gnu dot org
2005-08-30 23:48 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-28 3:36 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-28 03:14 -------
I should say after I finish testing the patch for PR 23408 which is another GC freeing issue.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23547
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug middle-end/23547] [4.1 regression] [non-unit-at-a-time] ICE with recursive call to nested function
2005-08-24 16:15 [Bug c/23547] New: [4.1 regression] ICE with recursive call to nested function reichelt at gcc dot gnu dot org
` (6 preceding siblings ...)
2005-08-28 3:36 ` pinskia at gcc dot gnu dot org
@ 2005-08-30 23:48 ` pinskia at gcc dot gnu dot org
2005-09-02 12:41 ` cvs-commit at gcc dot gnu dot org
2005-09-02 12:45 ` pinskia at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-30 23:48 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-30 22:33 -------
Patch posted here: <http://gcc.gnu.org/ml/gcc-patches/2005-08/msg01794.html>.
--
What |Removed |Added
----------------------------------------------------------------------------
URL| |http://gcc.gnu.org/ml/gcc-
| |patches/2005-
| |08/msg01794.html
Keywords| |patch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23547
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug middle-end/23547] [4.1 regression] [non-unit-at-a-time] ICE with recursive call to nested function
2005-08-24 16:15 [Bug c/23547] New: [4.1 regression] ICE with recursive call to nested function reichelt at gcc dot gnu dot org
` (7 preceding siblings ...)
2005-08-30 23:48 ` pinskia at gcc dot gnu dot org
@ 2005-09-02 12:41 ` cvs-commit at gcc dot gnu dot org
2005-09-02 12:45 ` pinskia at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-09-02 12:41 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-09-02 12:41 -------
Subject: Bug 23547
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: pinskia@gcc.gnu.org 2005-09-02 12:41:08
Modified files:
gcc : ChangeLog tree-nested.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/gcc.dg: pr23547.c
Log message:
2005-09-02 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/23547
* tree-nested.c (struct var_map_elt): Mark with GTY.
(struct nesting_info): Mark with GTY. Mark var_map's param is struct
var_map_elt.
(lookup_field_for_decl): Allocate new element in GC memory.
(lookup_tramp_for_decl): Likewise.
(convert_nl_goto_reference): Likewise
(create_nesting_tree): Allocate info in GC memory. Likewise for info->var_map.
(free_nesting_tree): Free with ggc_free instead of free.
(root): New static variable.
(lower_nested_functions): Remove root as local variable. And zero out root at the end of the function.
2005-09-02 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/23547
* gcc.dg/pr23547.c: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9885&r2=2.9886
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-nested.c.diff?cvsroot=gcc&r1=2.29&r2=2.30
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5994&r2=1.5995
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/pr23547.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23547
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug middle-end/23547] [4.1 regression] [non-unit-at-a-time] ICE with recursive call to nested function
2005-08-24 16:15 [Bug c/23547] New: [4.1 regression] ICE with recursive call to nested function reichelt at gcc dot gnu dot org
` (8 preceding siblings ...)
2005-09-02 12:41 ` cvs-commit at gcc dot gnu dot org
@ 2005-09-02 12:45 ` pinskia at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-02 12:45 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-02 12:45 -------
Fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23547
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2005-09-02 12:45 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-24 16:15 [Bug c/23547] New: [4.1 regression] ICE with recursive call to nested function reichelt at gcc dot gnu dot org
2005-08-24 16:17 ` [Bug c/23547] " reichelt at gcc dot gnu dot org
2005-08-24 16:39 ` pinskia at gcc dot gnu dot org
2005-08-24 16:55 ` [Bug middle-end/23547] [4.1 regression] [non-unit-at-a-time] " pinskia at gcc dot gnu dot org
2005-08-25 16:43 ` reichelt at gcc dot gnu dot org
2005-08-28 3:05 ` pinskia at gcc dot gnu dot org
2005-08-28 3:14 ` pinskia at gcc dot gnu dot org
2005-08-28 3:36 ` pinskia at gcc dot gnu dot org
2005-08-30 23:48 ` pinskia at gcc dot gnu dot org
2005-09-02 12:41 ` cvs-commit at gcc dot gnu dot org
2005-09-02 12:45 ` pinskia at gcc dot gnu dot 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).