This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/44832] [4.6 Regression] -fcompare-debug failure for C++ i386.c
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jul 2010 11:45:16 -0000
- Subject: [Bug debug/44832] [4.6 Regression] -fcompare-debug failure for C++ i386.c
- References: <bug-44832-5394@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #38 from rguenth at gcc dot gnu dot org 2010-07-08 11:45 -------
Index: gcc/tree-vrp.c
===================================================================
--- gcc/tree-vrp.c (revision 161949)
+++ gcc/tree-vrp.c (working copy)
@@ -4534,12 +4538,11 @@ compare_case_labels (const void *p1, con
{
const_tree const case1 = *(const_tree const*)p1;
const_tree const case2 = *(const_tree const*)p2;
- unsigned int uid1 = DECL_UID (CASE_LABEL (case1));
- unsigned int uid2 = DECL_UID (CASE_LABEL (case2));
+ unsigned int uid1 = LABEL_DECL_UID (CASE_LABEL (case1));
+ unsigned int uid2 = LABEL_DECL_UID (CASE_LABEL (case2));
- if (uid1 < uid2)
- return -1;
- else if (uid1 == uid2)
+ if (uid1 == uid2
+ || uid1 == -1u || uid2 == -1u)
{
/* Make sure the default label is first in a group. */
if (!CASE_LOW (case1))
@@ -4549,8 +4552,7 @@ compare_case_labels (const void *p1, con
else
return tree_int_cst_compare (CASE_LOW (case1), CASE_LOW (case2));
}
- else
- return 1;
+ return uid1 < uid2 ? -1 : 1;
}
fixes the testcase.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44832