This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/68839] [6 regression] ICE in contains_point at diagnostic-show-locus.c:340
- From: "dmalcolm at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 10 Dec 2015 19:26:21 +0000
- Subject: [Bug c/68839] [6 regression] ICE in contains_point at diagnostic-show-locus.c:340
- Auto-submitted: auto-generated
- References: <bug-68839-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68839
David Malcolm <dmalcolm at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dmalcolm at gcc dot gnu.org
--- Comment #3 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Thanks; I agree that it's a dup.
The ranges in question are:
$2 = {locus = 201728, src_range = {m_start = 201568, m_finish = 2147483641},
data = 0x0}
(gdb) call inform (201728, "locus")
pr68473-3.c: In function âfâ:
pr68473-3.c:11:19: note: locus
else if (p->q != NULL) { }
^
(gdb) call inform (201568, "m_start")
pr68473-3.c:11:14: note: m_start
else if (p->q != NULL) { }
^
(gdb) call inform (2147483641, "m_finish")
pr68473-3.c:6:21: note: m_finish
#define NULL (void*)0
^
pr68473-3.c:11:22: note: in expansion of macro âNULLâ
else if (p->q != NULL) { }
^~~~
With the patch, it prints:
pr68473-3.c: In function âfâ:
pr68473-3.c:11:19: warning: duplicated âifâ condition [-Wduplicated-cond]
else if (p->q != NULL) { }
^
pr68473-3.c:10:14: note: previously used here
if (p->q != NULL) { }
^
i.e. no range information. I believe this is degrading gracefully to
the old "just carets, no ranges" result.
Perhaps ideally it might print some form of the ranges as they pertain to the
primary caret within the location:
pr68473-3.c: In function âfâ:
pr68473-3.c:11:19: warning: duplicated âifâ condition [-Wduplicated-cond]
else if (p->q != NULL) { }
~~~~~^~~~~~~
pr68473-3.c:10:14: note: previously used here
if (p->q != NULL) { }
~~~~~^~~~~~~
but making it do that would be a much more involved patch.