| Summary: | [4.0/4.1 Regression] ICE with dwarf for incomplete element type argument | ||
|---|---|---|---|
| Product: | gcc | Reporter: | stelios <sxanth> |
| Component: | debug | Assignee: | Steven Bosscher <steven> |
| Status: | RESOLVED FIXED | ||
| Severity: | minor | CC: | flash, gcc-bugs |
| Priority: | P2 | Keywords: | error-recovery, ice-on-invalid-code, patch |
| Version: | 4.0.0 | ||
| Target Milestone: | 4.0.2 | ||
| URL: | http://gcc.gnu.org/ml/gcc-patches/2005-07/msg01772.html | ||
| Host: | Target: | ||
| Build: | Known to work: | ||
| Known to fail: | Last reconfirmed: | 2005-02-23 15:42:59 | |
| Attachments: | * dwarf2out.c (gen_formal_types_die): Robustify. | ||
|
Description
stelios
2005-02-23 12:58:30 UTC
The code is invalid as mentioned before in other bugs. Confirmed, a regression. Created attachment 8277 [details]
* dwarf2out.c (gen_formal_types_die): Robustify.
I'll test this a bit and post it if it looks OK.
PalmSource bug 105106. Happens on code which is supposedly valid, but I haven't verified that. Let's try this patch then.
Index: passes.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/passes.c,v
retrieving revision 2.105
diff -u -3 -p -r2.105 passes.c
--- passes.c 19 Jul 2005 18:45:56 -0000 2.105
+++ passes.c 26 Jul 2005 10:12:55 -0000
@@ -175,7 +175,10 @@ rest_of_decl_compilation (tree decl,
timevar_pop (TV_VARCONST);
}
- else if (TREE_CODE (decl) == TYPE_DECL)
+ else if (TREE_CODE (decl) == TYPE_DECL
+ /* Like in rest_of_type_compilation, avoid confusing the debug
+ information machinery when there are errors. */
+ && !(sorrycount || errorcount))
{
timevar_push (TV_SYMOUT);
debug_hooks->type_decl (decl, !top_level);
Subject: Bug 20161 CVSROOT: /cvs/gcc Module name: gcc Changes by: steven@gcc.gnu.org 2005-07-28 01:24:20 Modified files: gcc : ChangeLog passes.c Log message: PR debug/20161 * passes.c (rest_of_decl_compilation): If decl is a type and we have encountered errors, don't emit debug information. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9572&r2=2.9573 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/passes.c.diff?cvsroot=gcc&r1=2.105&r2=2.106 be fixeth, buglette! Subject: Bug 20161 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: steven@gcc.gnu.org 2005-07-28 01:28:59 Modified files: gcc : passes.c ChangeLog Log message: PR debug/20161 * passes.c (rest_of_decl_compilation): If decl is a type and we have encountered errors, don't emit debug information. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/passes.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.72.2.2&r2=2.72.2.3 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.334&r2=2.7592.2.335 The patch looks good on the first of our files to elicit this bug. The following line causes the ICE; the line after does not. /opt2/gcc401-chkall-9330/bin/g++ -g ../cpp/bugfiles/GCC_bugfiles/error/105106_jdinput.c /opt2/gcc401-chkall-8277-9330/bin/g++ -g ../cpp/bugfiles/GCC_bugfiles/error/105106_jdinput.c I'll crash test the checking=yes version overnight. (Note that so far I'm only crash-testing; I'm not yet doing correctness testing.) The patch looked good in overnight crash-testing over five thousand files in our source tree. I used checking=yes version with patches 8277 and 9330. I'm afraid last night's results aren't directly comparable to my last run with an unpatched g++, but the internal errors were a small subset of the unpatched version, 4 vs 30. (Two of those four were bug 23125, one was 23089, and I'll file the other one.) |