[Bug c/99323] [9/10/11 Regression] ICE in add_hint, at diagnostic-show-locus.c:2234 since r8-379-gd1b5f5cc3cfd148e
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99323 --- Comment #4 from CVS Commits --- The master branch has been updated by David Malcolm : https://gcc.gnu.org/g:41fbacdd10305654b1d10f887fa3f4677f9b8f34 commit r11-7461-g41fbacdd10305654b1d10f887fa3f4677f9b8f34 Author: David Malcolm Date: Tue Mar 2 15:46:06 2021 -0500 diagnostics: fix ICE on fix-it hints on very long lines [PR99323] PR c/99323 describes an ICE due to a failed assertion deep inside the fix-it printing machinery, where the fix-it hints on one line have not been properly sorted in layout's constructor. The underlying issue occurs when multiple fix-it hints affect a line wider that LINE_MAP_MAX_COLUMN_NUMBER, where the location_t values for characters after that threshold fall back to having column zero. It's not meaningful to try to handle fix-it hints without column information, so this patch rejects them as they are added to the rich_location, falling back to the "no fix-it hints on this diagnostic" case, fixing the crash. gcc/ChangeLog: PR c/99323 * diagnostic-show-locus.c (selftest::test_one_liner_many_fixits_2): Fix accidental usage of column 0. gcc/testsuite/ChangeLog: PR c/99323 * gcc.dg/pr99323-1.c: New test. * gcc.dg/pr99323-2.c: New test. libcpp/ChangeLog: PR c/99323 * line-map.c (rich_location::maybe_add_fixit): Reject fix-it hints at column 0.
[Bug c/99323] [9/10/11 Regression] ICE in add_hint, at diagnostic-show-locus.c:2234 since r8-379-gd1b5f5cc3cfd148e
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99323 David Malcolm changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |dmalcolm at gcc dot gnu.org --- Comment #3 from David Malcolm --- Mine
[Bug c/99323] [9/10/11 Regression] ICE in add_hint, at diagnostic-show-locus.c:2234 since r8-379-gd1b5f5cc3cfd148e
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99323 --- Comment #2 from Martin Liška --- Slightly reduced test-case: $ cat x.c typedef struct { } REFERENCE; #define LIM2() LIM1() #define LIM3() LIM2() LIM2() LIM2() LIM2() LIM2() LIM2() #define LIM4() \ LIM3() LIM3() LIM3() LIM3() LIM3() LIM3() LIM3() LIM3() LIM3() LIM3() #define LIM5() \ LIM4() LIM4() LIM4() LIM4() LIM4() LIM4() LIM4() LIM4() LIM4() LIM4() #define LIM1() DEF(), REFERENCE references[] = {LIM5()}
[Bug c/99323] [9/10/11 Regression] ICE in add_hint, at diagnostic-show-locus.c:2234 since r8-379-gd1b5f5cc3cfd148e
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99323 Martin Liška changed: What|Removed |Added Status|UNCONFIRMED |NEW Summary|[9/10/11 Regression] ICE in |[9/10/11 Regression] ICE in |add_hint, at|add_hint, at |diagnostic-show-locus.c:223 |diagnostic-show-locus.c:223 |4 |4 since ||r8-379-gd1b5f5cc3cfd148e CC||marxin at gcc dot gnu.org Ever confirmed|0 |1 Last reconfirmed||2021-03-02 --- Comment #1 from Martin Liška --- Confirmed, started with r8-379-gd1b5f5cc3cfd148e.
[Bug c/99323] [9/10/11 Regression] ICE in add_hint, at diagnostic-show-locus.c:2234
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99323 Richard Biener changed: What|Removed |Added Target Milestone|--- |9.4 CC||dmalcolm at gcc dot gnu.org