Summary: | [3.3 Regression] crash on duplicate label definition | ||
---|---|---|---|
Product: | gcc | Reporter: | Zack Weinberg <zackw> |
Component: | c++ | Assignee: | Steven Bosscher <steven> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | gcc-bugs |
Priority: | P1 | Keywords: | error-recovery, ice-on-invalid-code |
Version: | 3.4.0 | ||
Target Milestone: | 3.3.2 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2003-09-04 15:03:42 | |
Attachments: | This should fix it |
Description
Zack Weinberg
2003-07-19 21:32:25 UTC
I can confirm gcc ICE on the mainline (20030719) and it did not ICE on 2.95.3 Also using Phil's regression hunter, 2000-12-31 ICE's also. Also 2.96 20000731 (Red Hat Linux 7.2 2.96-109) (yes I know that is not a released version but still), it also ICEs. Created attachment 4504 [details]
This should fix it
Steven: please add the test case to the C++ test suite, verify with a bootstrap cycle, and send a complete patch to gcc-patches. It _is_ a regression, after all. Steven, did you close the PR by accident? It still fails for me as of this night, and I don't see any CVS commits in the audit trail. W. Still fails. Subject: RE: [3.3/3.4 Regresion] crash on duplicate label definition Well, if I closed it something went wrong. I want to "accept" the bug as one that I will formally submit a patch for soon. -----Original Message----- From: bangerth at dealii dot org To: steven@gcc.gnu.org Sent: 9/4/03 4:37 PM Subject: [Bug c++/11595] [3.3/3.4 Regresion] crash on duplicate label definition PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11595 bangerth at dealii dot org changed: What |Removed |Added ------------------------------------------------------------------------ ---- CC| |steven at gcc dot gnu dot | |org Last reconfirmed|2003-09-04 10:04:28 |2003-09-04 14:37:30 date| | ------- Additional Comments From bangerth at dealii dot org 2003-09-04 14:37 ------- Steven, did you close the PR by accident? It still fails for me as of this night, and I don't see any CVS commits in the audit trail. W. ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. Repeat after me: RADIO BUTTONS SUCK Oh great, and now Bugzilla let's me assign to "unassigned at gcc.gnu.org", WTF!? Comment on attachment 4504 [details]
This should fix it
Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.1121
diff -c -p -3 -r1.1121 decl.c
*** decl.c 4 Sep 2003 03:18:02 -0000 1.1121
--- decl.c 6 Sep 2003 14:12:36 -0000
*************** check_goto (tree decl)
*** 4937,4944 ****
}
/* Define a label, specifying the location in the source file.
! Return the LABEL_DECL node for the label, if the definition is valid.
! Otherwise return 0. */
tree
define_label (location_t location, tree name)
--- 4937,4943 ----
}
/* Define a label, specifying the location in the source file.
! Return the LABEL_DECL node for the label. */
tree
define_label (location_t location, tree name)
*************** define_label (location_t location, tree
*** 4961,4970 ****
pedwarn ("label named wchar_t");
if (DECL_INITIAL (decl) != NULL_TREE)
! {
! error ("duplicate label `%D'", decl);
! POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, NULL_TREE);
! }
else
{
/* Mark label as having been defined. */
--- 4960,4966 ----
pedwarn ("label named wchar_t");
if (DECL_INITIAL (decl) != NULL_TREE)
! error ("duplicate label `%D'", decl);
else
{
/* Mark label as having been defined. */
*************** define_label (location_t location, tree
*** 4977,4985 ****
ent->binding_level = current_binding_level;
}
check_previous_gotos (decl);
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, decl);
}
! timevar_pop (TV_NAME_LOOKUP);
}
struct cp_switch
--- 4973,4981 ----
ent->binding_level = current_binding_level;
}
check_previous_gotos (decl);
}
!
! POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, decl);
}
struct cp_switch
Fixed for mainline Subject: Bug 11595 CVSROOT: /cvs/gcc Module name: gcc Changes by: steven@gcc.gnu.org 2003-09-06 15:44:35 Modified files: gcc/cp : decl.c ChangeLog Log message: PR c++/11595 * decl.c (define_label): Remove unreachable timevar pop. Always return the decl, even if the definition is invalid. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1121&r2=1.1122 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3650&r2=1.3651 Subject: Bug 11595 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: steven@gcc.gnu.org 2003-09-09 07:20:48 Modified files: gcc/cp : ChangeLog decl.c Log message: PR c++/11595 * decl.c (define_label): Remove unreachable timeva pop. Always return the decl, even if the definition is invalid. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.204&r2=1.3076.2.205 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.965.2.60&r2=1.965.2.61 fixed |