public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
@ 2020-07-30 15:51 mike at cchtml dot com
  2020-07-30 15:52 ` [Bug c++/96391] " mike at cchtml dot com
                   ` (30 more replies)
  0 siblings, 31 replies; 32+ messages in thread
From: mike at cchtml dot com @ 2020-07-30 15:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

            Bug ID: 96391
           Summary: internal compiler error: in linemap_compare_locations,
                    at libcpp/line-map.c:1359
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mike at cchtml dot com
  Target Milestone: ---

Compiling the Wine Gecko project on Fedora for a Windows target produces an
internal compiler error. GCC 10.1 and 10.2 are affected. Last known working
with GCC 9.2.1.

When I compile it with the default arguments I get the error.

When I compile it with '-save-temps' to get the preprocessed file no error
occurs. No error occurs if I compile the preprocessed file either.

I'm not sure what to provide to reproduce this besides the SRPM file to compile
it.

https://kojipkgs.fedoraproject.org//packages/mingw-wine-gecko/2.47.1/2.fc32/src/mingw-wine-gecko-2.47.1-2.fc32.src.rpm

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug c++/96391] internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
@ 2020-07-30 15:52 ` mike at cchtml dot com
  2020-07-31  6:15 ` [Bug preprocessor/96391] [10/11 Regression] " rguenth at gcc dot gnu.org
                   ` (29 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: mike at cchtml dot com @ 2020-07-30 15:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #1 from Michael Cronenworth <mike at cchtml dot com> ---
Created attachment 48963
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48963&action=edit
g++ command and output of error

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10/11 Regression] internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
  2020-07-30 15:52 ` [Bug c++/96391] " mike at cchtml dot com
@ 2020-07-31  6:15 ` rguenth at gcc dot gnu.org
  2020-07-31  6:18 ` marxin at gcc dot gnu.org
                   ` (28 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-07-31  6:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.3
      Known to fail|                            |10.1.0, 10.2.0
           Keywords|                            |ice-on-valid-code
            Summary|internal compiler error: in |[10/11 Regression] internal
                   |linemap_compare_locations,  |compiler error: in
                   |at libcpp/line-map.c:1359   |linemap_compare_locations,
                   |                            |at libcpp/line-map.c:1359
             Target|                            |i686-w64-mingw32
      Known to work|                            |9.2.1
          Component|c++                         |preprocessor

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
A backtrace would be helpful, I suspect a stale location somewhere.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10/11 Regression] internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
  2020-07-30 15:52 ` [Bug c++/96391] " mike at cchtml dot com
  2020-07-31  6:15 ` [Bug preprocessor/96391] [10/11 Regression] " rguenth at gcc dot gnu.org
@ 2020-07-31  6:18 ` marxin at gcc dot gnu.org
  2020-07-31 18:13 ` mike at cchtml dot com
                   ` (27 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-07-31  6:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
All right, so please provide pre-processed source file (-E option). I can then
try to reproduce it..

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10/11 Regression] internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (2 preceding siblings ...)
  2020-07-31  6:18 ` marxin at gcc dot gnu.org
@ 2020-07-31 18:13 ` mike at cchtml dot com
  2020-09-04 17:50 ` jan.smets at nokia dot com
                   ` (26 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: mike at cchtml dot com @ 2020-07-31 18:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #4 from Michael Cronenworth <mike at cchtml dot com> ---
The preprocessed file, even XZ compressed, is too large for attaching here.

https://github.com/mooninite/gcc-bug/blob/master/Unified_cpp_widget_windows0.ii.xz

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10/11 Regression] internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (3 preceding siblings ...)
  2020-07-31 18:13 ` mike at cchtml dot com
@ 2020-09-04 17:50 ` jan.smets at nokia dot com
  2020-10-07 19:46 ` qinzhao at gcc dot gnu.org
                   ` (25 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: jan.smets at nokia dot com @ 2020-09-04 17:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

Jan Smets <jan.smets at nokia dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jan.smets at nokia dot com

--- Comment #5 from Jan Smets <jan.smets at nokia dot com> ---
Similar issue @ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96935
(with bisect to the 'last known good' version)

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10/11 Regression] internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (4 preceding siblings ...)
  2020-09-04 17:50 ` jan.smets at nokia dot com
@ 2020-10-07 19:46 ` qinzhao at gcc dot gnu.org
  2020-10-09 16:48 ` qinzhao at gcc dot gnu.org
                   ` (24 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: qinzhao at gcc dot gnu.org @ 2020-10-07 19:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #6 from qinzhao at gcc dot gnu.org ---
when using gcc10.2 to compile our application, we have the same compilation
error.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10/11 Regression] internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (5 preceding siblings ...)
  2020-10-07 19:46 ` qinzhao at gcc dot gnu.org
@ 2020-10-09 16:48 ` qinzhao at gcc dot gnu.org
  2020-10-09 16:49 ` qinzhao at gcc dot gnu.org
                   ` (23 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: qinzhao at gcc dot gnu.org @ 2020-10-09 16:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #7 from qinzhao at gcc dot gnu.org ---
as we noticed, when using gcc10.2.1 compile our application, 528 C++ modules
failed with this bug. 

looks like a high priority bug to me.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10/11 Regression] internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (6 preceding siblings ...)
  2020-10-09 16:48 ` qinzhao at gcc dot gnu.org
@ 2020-10-09 16:49 ` qinzhao at gcc dot gnu.org
  2020-12-06  3:18 ` mike at cchtml dot com
                   ` (22 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: qinzhao at gcc dot gnu.org @ 2020-10-09 16:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

qinzhao at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10/11 Regression] internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (7 preceding siblings ...)
  2020-10-09 16:49 ` qinzhao at gcc dot gnu.org
@ 2020-12-06  3:18 ` mike at cchtml dot com
  2021-02-09  0:10 ` dmalcolm at gcc dot gnu.org
                   ` (21 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: mike at cchtml dot com @ 2020-12-06  3:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #8 from Michael Cronenworth <mike at cchtml dot com> ---
(In reply to Jan Smets from comment #5)
> Similar issue @ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96935

I applied the patch from that bug but it did not fix this issue.

Anything I can do to help push this bug along?

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10/11 Regression] internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (8 preceding siblings ...)
  2020-12-06  3:18 ` mike at cchtml dot com
@ 2021-02-09  0:10 ` dmalcolm at gcc dot gnu.org
  2021-02-09  7:06 ` jan.smets at nokia dot com
                   ` (20 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2021-02-09  0:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dmalcolm at gcc dot gnu.org

--- Comment #9 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
I tried reproducing this using the .ii file (albeit with trunk), but it's not
triggering for me.

(In reply to Michael Cronenworth from comment #0)
[...]
> When I compile it with '-save-temps' to get the preprocessed file no error
> occurs. No error occurs if I compile the preprocessed file either.

...which suggests to me that maybe this is in a diagnostic that relies on
re-reading the sources, such as -Wmisleading-indentation.

Alternatively, the crash is in linemap_compare_locations.  This is used by
linemap_location_before_p, which is used by -Wuninitialized and
-Wmaybe-uninitialized.

So those could be a few warnings to try disabling to see if we can narrow this
down; try adding:
  -Wno-misleading-indentation
  -Wno-uninitialized
  -Wno-maybe-uninitialized
and see if one of those fixes it.

Michael: are you able to invoke the crashing command under gdb?  Adding
  -wrapper gdb,--args
to the g++ invocation will make it invoke cc1plus under the debugger, from
which you can get a backtrace.
  (gdb) run
  [...hopefully the process crashes...]
  (gdb) bt
and hopefully will shed light on where it's crashing.

Hope this is helpful

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10/11 Regression] internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (9 preceding siblings ...)
  2021-02-09  0:10 ` dmalcolm at gcc dot gnu.org
@ 2021-02-09  7:06 ` jan.smets at nokia dot com
  2021-02-09 14:40 ` dmalcolm at gcc dot gnu.org
                   ` (19 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: jan.smets at nokia dot com @ 2021-02-09  7:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #10 from Jan Smets <jan.smets at nokia dot com> ---
I have a couple of changes in my own tree. I had a couple of different issues
and I don't recall exactly what change was for what specifically.

I locally have a revert of 0d48e8779c6a9ac88f5efd1b4a2d40f43ef75faf "Support
string locations for C++ in -Wformat (PR c++/56856)" , plus the ugly hack patch
from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96940

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10/11 Regression] internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (10 preceding siblings ...)
  2021-02-09  7:06 ` jan.smets at nokia dot com
@ 2021-02-09 14:40 ` dmalcolm at gcc dot gnu.org
  2021-02-10  0:04 ` mike at cchtml dot com
                   ` (18 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2021-02-09 14:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #11 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
FWIW I had another go at reproduing this, but after various failures due to
running out of disk space, I was able to rebuild the SRPM from comment #0
without seeing the crash, via:

  mock --rebuild mingw-wine-gecko-2.47.1-2.fc32.src.rpm -N -r fedora-32-i386

(which the root.log tells me used gcc-c++-10.2.1-9.fc32.i686.rpm).

Michael: is that the mock configuration that's failing for you, or are you
using a different one?

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10/11 Regression] internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (11 preceding siblings ...)
  2021-02-09 14:40 ` dmalcolm at gcc dot gnu.org
@ 2021-02-10  0:04 ` mike at cchtml dot com
  2021-02-10 11:42 ` dmalcolm at gcc dot gnu.org
                   ` (17 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: mike at cchtml dot com @ 2021-02-10  0:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #12 from Michael Cronenworth <mike at cchtml dot com> ---
(In reply to David Malcolm from comment #11)
> FWIW I had another go at reproduing this, but after various failures due to
> running out of disk space, I was able to rebuild the SRPM from comment #0
> without seeing the crash, via:
Yes, and with -save-temps you double the disk space required. :(

>   mock --rebuild mingw-wine-gecko-2.47.1-2.fc32.src.rpm -N -r fedora-32-i386

That's a reasonable mock command for a Fedora 32 build.

> (which the root.log tells me used gcc-c++-10.2.1-9.fc32.i686.rpm).

That's the Linux GCC. You will want to see the version for MinGW:
mingw-gcc-9.2.1-6.fc32 - which does not crash so I'm not surprised you didn't
crash.

> Michael: is that the mock configuration that's failing for you, or are you
> using a different one?

Try: mock --rebuild mingw-wine-gecko-2.47.1-2.fc32.src.rpm -N -r fedora-33-i386

It's still failing for me today. I'm working around it by passing -save-temps
to CFLAGS as packages that fail to compile in Fedora for too long are dropped
from the distribution.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10/11 Regression] internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (12 preceding siblings ...)
  2021-02-10  0:04 ` mike at cchtml dot com
@ 2021-02-10 11:42 ` dmalcolm at gcc dot gnu.org
  2021-02-10 12:15 ` dmalcolm at gcc dot gnu.org
                   ` (16 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2021-02-10 11:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #13 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
(In reply to Michael Cronenworth from comment #12)
> That's the Linux GCC. You will want to see the version for MinGW:
> mingw-gcc-9.2.1-6.fc32 - which does not crash so I'm not surprised you
> didn't crash.

Thanks.

> > Michael: is that the mock configuration that's failing for you, or are you
> > using a different one?
> 
> Try: mock --rebuild mingw-wine-gecko-2.47.1-2.fc32.src.rpm -N -r
> fedora-33-i386

Thanks; however with that command line it fails for me very early in the build
with:
 0:03.33 Generating
/builddir/build/BUILD/wine-gecko-2.47.1/wine-gecko-2.47.1/configure using
autoconf
 0:03.34 autoconf: configure.in: No such file or directory
 0:03.34 gmake: *** [client.mk:323:
/builddir/build/BUILD/wine-gecko-2.47.1/wine-gecko-2.47.1/configure] Error 1

Am I doing something wrong, or does that src.rpm need reworking?  (sorry, my
packaging skills are rather rusty)

This is with the src.rpm downloaded from the link in comment #0:

$ md5sum mingw-wine-gecko-2.47.1-2.fc32.src.rpm
82684032aabc8bd3b19923aa9452eb5e  mingw-wine-gecko-2.47.1-2.fc32.src.rpm

$ rpm -q mock
mock-2.3-1.fc32.noarch

If you supply me with a .src.rpm that manifests the compiler crash, I can try
to debug it and find a simpler reproducer.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10/11 Regression] internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (13 preceding siblings ...)
  2021-02-10 11:42 ` dmalcolm at gcc dot gnu.org
@ 2021-02-10 12:15 ` dmalcolm at gcc dot gnu.org
  2021-02-10 15:05 ` dmalcolm at gcc dot gnu.org
                   ` (15 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2021-02-10 12:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #14 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
(In reply to David Malcolm from comment #13)
> $ rpm -q mock
> mock-2.3-1.fc32.noarch

Sorry, my bad; I had quite an old mock.  I've upgraded, and the build is now
progressing beyond that point.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10/11 Regression] internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (14 preceding siblings ...)
  2021-02-10 12:15 ` dmalcolm at gcc dot gnu.org
@ 2021-02-10 15:05 ` dmalcolm at gcc dot gnu.org
  2021-02-10 15:57 ` rguenther at suse dot de
                   ` (14 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2021-02-10 15:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #15 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
#0  fancy_abort (file=0x95b0ab6 "../../libcpp/line-map.c", line=1359,
function=0x95b0ace "linemap_compare_locations")
    at ../../gcc/diagnostic.c:1778
#1  0x08fcbecf in linemap_compare_locations (set=0xf7ffb000, pre=2146782942,
post=<optimized out>) at ../../libcpp/line-map.c:1359
#2  0x080f4378 in linemap_location_before_p (loc_b=2146782943,
loc_a=2146782942, set=<optimized out>)
    at ../../gcc/../libcpp/include/line-map.h:1247
#3  min_location (locb=2146782942, loca=2146782943) at
../../gcc/cp/decl.c:10641
#4  smallest_type_location (type_quals=type_quals@entry=1,
locations=locations@entry=0xffffc778) at ../../gcc/cp/decl.c:10673
#5  0x081024bb in grokdeclarator (declarator=0xa03c950, declspecs=0xffffc778,
decl_context=NORMAL, initialized=0, attrlist=0xffffc62c)
    at ../../gcc/cp/decl.c:11008
#6  0x0810a109 in start_decl (declarator=0xa03c950, declspecs=0xffffc778,
initialized=0, attributes=<optimized out>, prefix_attributes=0x0, 
    pushed_scope_p=0xffffc68c) at ../../gcc/cp/decl.c:5226
#7  0x0818face in cp_parser_init_declarator (parser=0xec83dae0,
flags=<optimized out>, decl_specifiers=0xffffc778, checks=0x0, 
    function_definition_allowed_p=true, member_p=false,
declares_class_or_enum=0, function_definition_p=0xffffc71c,
maybe_range_for_decl=0x0, 
    init_loc=0xffffc710, auto_result=0xffffc7fc) at ../../gcc/cp/parser.c:20776
#8  0x08172e04 in cp_parser_simple_declaration (parser=0xec83dae0,
function_definition_allowed_p=<optimized out>, maybe_range_for_decl=0x0)
    at ../../gcc/cp/parser.c:13739
#9  0x08198e6a in cp_parser_declaration (parser=0xec83dae0) at
../../gcc/cp/parser.c:13438
#10 0x081998cb in cp_parser_declaration_seq_opt (parser=<optimized out>) at
../../gcc/cp/parser.c:13314
#11 cp_parser_linkage_specification (parser=0xec83dae0) at
../../gcc/cp/parser.c:14632
#12 0x08198ed2 in cp_parser_declaration (parser=0xec83dae0) at
../../gcc/cp/parser.c:13375
#13 0x081995b6 in cp_parser_translation_unit (parser=0xec83dae0) at
../../gcc/cp/parser.c:4734
#14 c_parse_file () at ../../gcc/cp/parser.c:44001
#15 0x0825a13c in c_common_parse_file () at ../../gcc/c-family/c-opts.c:1190
#16 0x086be8ce in compile_file () at ../../gcc/toplev.c:458
#17 0x0809227d in do_compile () at ../../gcc/toplev.c:2298
#18 toplev::main (this=0xffffca4e, argc=120, argv=0xffffcb24) at
../../gcc/toplev.c:2437
#19 0x08096231 in main (argc=120, argv=0xffffcb24) at ../../gcc/main.c:39


It's hitting the abort at line 1359 within linemap_compare_locations:

1350          /* So pre and post represent two tokens that are present in a
1351             same macro expansion.  Let's see if the token for pre was
1352             before the token for post in that expansion.  */
1353          unsigned i0, i1;
1354          const struct line_map *map =
1355            first_map_in_common (set, pre, post, &l0, &l1);
1356    
1357          if (map == NULL)
1358            /* This should not be possible.  */
1359            abort ();

where:

(gdb) p /x loc_a
$1 = 0x7ff54ede
(gdb) p /x loc_b
$2 = 0x7ff54edf
(gdb) call inform (loc_a, "loc_a")
In file included from
/usr/i686-w64-mingw32/sys-root/mingw/include/minwindef.h:163,
                 from /usr/i686-w64-mingw32/sys-root/mingw/include/windef.h:8,
                 from
/usr/i686-w64-mingw32/sys-root/mingw/include/windows.h:69,
                 from
/builddir/build/BUILD/wine-gecko-2.47.1/wine-gecko-2.47.1/widget/windows/AudioSession.cpp:7,
                 from
/builddir/build/BUILD/wine-gecko-2.47.1/wine-gecko-2.47.1-x86/widget/windows/Unified_cpp_widget_windows0.cpp:2:
/usr/i686-w64-mingw32/sys-root/mingw/include/cfgmgr32.h: At global scope:
/usr/i686-w64-mingw32/sys-root/mingw/include/cfgmgr32.h:19: note: loc_a
   19 |   typedef CONST VOID *PCVOID;
      | 
(gdb) call inform (loc_b, "loc_b")
In file included from /usr/i686-w64-mingw32/sys-root/mingw/include/windef.h:8,
                 from
/usr/i686-w64-mingw32/sys-root/mingw/include/windows.h:69,
                 from
/builddir/build/BUILD/wine-gecko-2.47.1/wine-gecko-2.47.1/widget/windows/AudioSession.cpp:7,
                 from
/builddir/build/BUILD/wine-gecko-2.47.1/wine-gecko-2.47.1-x86/widget/windows/Unified_cpp_widget_windows0.cpp:2:
/usr/i686-w64-mingw32/sys-root/mingw/include/cfgmgr32.h:19: note: loc_b
   19 |   typedef CONST VOID *PCVOID;
      |

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10/11 Regression] internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (15 preceding siblings ...)
  2021-02-10 15:05 ` dmalcolm at gcc dot gnu.org
@ 2021-02-10 15:57 ` rguenther at suse dot de
  2021-02-10 16:08 ` qinzhao at gcc dot gnu.org
                   ` (13 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: rguenther at suse dot de @ 2021-02-10 15:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #16 from rguenther at suse dot de <rguenther at suse dot de> ---
On Wed, 10 Feb 2021, dmalcolm at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391
> 
> --- Comment #15 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
> #0  fancy_abort (file=0x95b0ab6 "../../libcpp/line-map.c", line=1359,
> function=0x95b0ace "linemap_compare_locations")
>     at ../../gcc/diagnostic.c:1778
> #1  0x08fcbecf in linemap_compare_locations (set=0xf7ffb000, pre=2146782942,
> post=<optimized out>) at ../../libcpp/line-map.c:1359
> #2  0x080f4378 in linemap_location_before_p (loc_b=2146782943,
> loc_a=2146782942, set=<optimized out>)
>     at ../../gcc/../libcpp/include/line-map.h:1247
> #3  min_location (locb=2146782942, loca=2146782943) at
> ../../gcc/cp/decl.c:10641
> #4  smallest_type_location (type_quals=type_quals@entry=1,
> locations=locations@entry=0xffffc778) at ../../gcc/cp/decl.c:10673
> #5  0x081024bb in grokdeclarator (declarator=0xa03c950, declspecs=0xffffc778,
> decl_context=NORMAL, initialized=0, attrlist=0xffffc62c)
>     at ../../gcc/cp/decl.c:11008
> #6  0x0810a109 in start_decl (declarator=0xa03c950, declspecs=0xffffc778,
> initialized=0, attributes=<optimized out>, prefix_attributes=0x0, 
>     pushed_scope_p=0xffffc68c) at ../../gcc/cp/decl.c:5226
> #7  0x0818face in cp_parser_init_declarator (parser=0xec83dae0,
> flags=<optimized out>, decl_specifiers=0xffffc778, checks=0x0, 
>     function_definition_allowed_p=true, member_p=false,
> declares_class_or_enum=0, function_definition_p=0xffffc71c,
> maybe_range_for_decl=0x0, 
>     init_loc=0xffffc710, auto_result=0xffffc7fc) at ../../gcc/cp/parser.c:20776
> #8  0x08172e04 in cp_parser_simple_declaration (parser=0xec83dae0,
> function_definition_allowed_p=<optimized out>, maybe_range_for_decl=0x0)
>     at ../../gcc/cp/parser.c:13739
> #9  0x08198e6a in cp_parser_declaration (parser=0xec83dae0) at
> ../../gcc/cp/parser.c:13438
> #10 0x081998cb in cp_parser_declaration_seq_opt (parser=<optimized out>) at
> ../../gcc/cp/parser.c:13314
> #11 cp_parser_linkage_specification (parser=0xec83dae0) at
> ../../gcc/cp/parser.c:14632
> #12 0x08198ed2 in cp_parser_declaration (parser=0xec83dae0) at
> ../../gcc/cp/parser.c:13375
> #13 0x081995b6 in cp_parser_translation_unit (parser=0xec83dae0) at
> ../../gcc/cp/parser.c:4734
> #14 c_parse_file () at ../../gcc/cp/parser.c:44001
> #15 0x0825a13c in c_common_parse_file () at ../../gcc/c-family/c-opts.c:1190
> #16 0x086be8ce in compile_file () at ../../gcc/toplev.c:458
> #17 0x0809227d in do_compile () at ../../gcc/toplev.c:2298
> #18 toplev::main (this=0xffffca4e, argc=120, argv=0xffffcb24) at
> ../../gcc/toplev.c:2437
> #19 0x08096231 in main (argc=120, argv=0xffffcb24) at ../../gcc/main.c:39
> 
> 
> It's hitting the abort at line 1359 within linemap_compare_locations:
> 
> 1350          /* So pre and post represent two tokens that are present in a
> 1351             same macro expansion.  Let's see if the token for pre was
> 1352             before the token for post in that expansion.  */
> 1353          unsigned i0, i1;
> 1354          const struct line_map *map =
> 1355            first_map_in_common (set, pre, post, &l0, &l1);
> 1356    
> 1357          if (map == NULL)
> 1358            /* This should not be possible.  */
> 1359            abort ();
> 
> where:
> 
> (gdb) p /x loc_a
> $1 = 0x7ff54ede
> (gdb) p /x loc_b
> $2 = 0x7ff54edf
> (gdb) call inform (loc_a, "loc_a")
> In file included from
> /usr/i686-w64-mingw32/sys-root/mingw/include/minwindef.h:163,
>                  from /usr/i686-w64-mingw32/sys-root/mingw/include/windef.h:8,
>                  from
> /usr/i686-w64-mingw32/sys-root/mingw/include/windows.h:69,
>                  from
> /builddir/build/BUILD/wine-gecko-2.47.1/wine-gecko-2.47.1/widget/windows/AudioSession.cpp:7,
>                  from
> /builddir/build/BUILD/wine-gecko-2.47.1/wine-gecko-2.47.1-x86/widget/windows/Unified_cpp_widget_windows0.cpp:2:
> /usr/i686-w64-mingw32/sys-root/mingw/include/cfgmgr32.h: At global scope:
> /usr/i686-w64-mingw32/sys-root/mingw/include/cfgmgr32.h:19: note: loc_a
>    19 |   typedef CONST VOID *PCVOID;
>       | 
> (gdb) call inform (loc_b, "loc_b")
> In file included from /usr/i686-w64-mingw32/sys-root/mingw/include/windef.h:8,
>                  from
> /usr/i686-w64-mingw32/sys-root/mingw/include/windows.h:69,
>                  from
> /builddir/build/BUILD/wine-gecko-2.47.1/wine-gecko-2.47.1/widget/windows/AudioSession.cpp:7,
>                  from
> /builddir/build/BUILD/wine-gecko-2.47.1/wine-gecko-2.47.1-x86/widget/windows/Unified_cpp_widget_windows0.cpp:2:
> /usr/i686-w64-mingw32/sys-root/mingw/include/cfgmgr32.h:19: note: loc_b
>    19 |   typedef CONST VOID *PCVOID;
>       |
> 

Guess you now have to trace first_map_in_common_1 where it "breaks"
since visually there should be a common map.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10/11 Regression] internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (16 preceding siblings ...)
  2021-02-10 15:57 ` rguenther at suse dot de
@ 2021-02-10 16:08 ` qinzhao at gcc dot gnu.org
  2021-02-10 16:57 ` dmalcolm at gcc dot gnu.org
                   ` (12 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: qinzhao at gcc dot gnu.org @ 2021-02-10 16:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #17 from qinzhao at gcc dot gnu.org ---
(In reply to David Malcolm from comment #15)


> where:
>
> (gdb) call inform (loc_a, "loc_a")
> In file included from
> /usr/i686-w64-mingw32/sys-root/mingw/include/minwindef.h:163,
>                  from
> /usr/i686-w64-mingw32/sys-root/mingw/include/windef.h:8,
>                  from
> /usr/i686-w64-mingw32/sys-root/mingw/include/windows.h:69,
>                  from
> /builddir/build/BUILD/wine-gecko-2.47.1/wine-gecko-2.47.1/widget/windows/
> AudioSession.cpp:7,
>                  from
> /builddir/build/BUILD/wine-gecko-2.47.1/wine-gecko-2.47.1-x86/widget/windows/
> Unified_cpp_widget_windows0.cpp:2:
> /usr/i686-w64-mingw32/sys-root/mingw/include/cfgmgr32.h: At global scope:
> /usr/i686-w64-mingw32/sys-root/mingw/include/cfgmgr32.h:19: note: loc_a
>    19 |   typedef CONST VOID *PCVOID;

Is the above line the failing point for the testing file?

there is a "CONST" qualifier. I am not sure whether it's helpful or not: we
found that deleting "CONST" from the source code helped the compilation to
succeed.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10/11 Regression] internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (17 preceding siblings ...)
  2021-02-10 16:08 ` qinzhao at gcc dot gnu.org
@ 2021-02-10 16:57 ` dmalcolm at gcc dot gnu.org
  2021-02-10 16:58 ` dmalcolm at gcc dot gnu.org
                   ` (11 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2021-02-10 16:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-02-10
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1

--- Comment #18 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
(In reply to qinzhao from comment #17)
> (In reply to David Malcolm from comment #15)

> > /builddir/build/BUILD/wine-gecko-2.47.1/wine-gecko-2.47.1-x86/widget/windows/
> > Unified_cpp_widget_windows0.cpp:2:
> > /usr/i686-w64-mingw32/sys-root/mingw/include/cfgmgr32.h: At global scope:
> > /usr/i686-w64-mingw32/sys-root/mingw/include/cfgmgr32.h:19: note: loc_a
> >    19 |   typedef CONST VOID *PCVOID;
> 
> Is the above line the failing point for the testing file?
> 
> there is a "CONST" qualifier. I am not sure whether it's helpful or not: we
> found that deleting "CONST" from the source code helped the compilation to
> succeed.

Yes.

Note how there are no column numbers for the macro invocation locations.

The issue occurs when location_t > LINE_MAP_MAX_LOCATION_WITH_COLS (enough
source has been compiled that we've stopped tracking column numbers).

We have two locations that are both from macro expansions, and return the same
output from:
  linemap_resolve_location (set, [...], LRK_MACRO_EXPANSION_POINT, NULL);
i.e. line 19 of cfgmgr32.h

cc1plus attempts to compare the locations of the two declarators ("const" and
"void"), decides that they are the same location, and assumes they must be from
the  same macro expansion - but they're only at the same location because we're
no longer attempting to track column numbers.

Converting one of both of those "const" and "void" to non-macros ought to work
around it.

I've created a minimal reproducer and will attempt a fix.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10/11 Regression] internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (18 preceding siblings ...)
  2021-02-10 16:57 ` dmalcolm at gcc dot gnu.org
@ 2021-02-10 16:58 ` dmalcolm at gcc dot gnu.org
  2021-02-10 19:33 ` [Bug preprocessor/96391] [10/11 Regression] ICE in linemap_compare_locations on "CONST VOID" in large C++ files cvs-commit at gcc dot gnu.org
                   ` (10 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2021-02-10 16:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #19 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
(In reply to David Malcolm from comment #18)
> Converting one of both of those "const" and "void" to non-macros ought to
"one or both", I meant to say

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10/11 Regression] ICE in linemap_compare_locations on "CONST VOID" in large C++ files
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (19 preceding siblings ...)
  2021-02-10 16:58 ` dmalcolm at gcc dot gnu.org
@ 2021-02-10 19:33 ` cvs-commit at gcc dot gnu.org
  2021-02-10 19:38 ` [Bug preprocessor/96391] [10 " dmalcolm at gcc dot gnu.org
                   ` (9 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-10 19:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #20 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by David Malcolm <dmalcolm@gcc.gnu.org>:

https://gcc.gnu.org/g:1f5c80883efce5242d892eb771ebb60830d20e0f

commit r11-7179-g1f5c80883efce5242d892eb771ebb60830d20e0f
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Wed Feb 10 14:33:10 2021 -0500

    libcpp: fix ICE comparing macro locations without column info [PR96391]

    PR preprocessor/96391 describes an ICE in the C++ frontend on:

      #define CONST const
      #define VOID void
      typedef CONST VOID *PCVOID;

    where the typedef line occurs after enough code has been compiled
    that location_t values are beyond LINE_MAP_MAX_LOCATION_WITH_COLS,
    and hence no column numbers are available.

    The issue occurs in linemap_compare_locations when comparing the
    locations of the "const" and "void" tokens.
    Upon resolving the LRK_MACRO_EXPANSION_POINT, both have the same
    location_t, the line of the "typedef" (with no column), and so
    the l0 == l1 clause is triggered, but they are not from the
    same macro expansion, leading first_map_in_common to return NULL
    and triggering the "abort" condition.

    This patch fixes the issue by checking when the two macro expansion
    point location_t values are equal that the value
    <= LINE_MAP_MAX_LOCATION_WITH_COLS and thus has column information,
    fixing the issue.

    gcc/testsuite/ChangeLog:
            PR preprocessor/96391
            * g++.dg/plugin/location-overflow-test-pr96391.c: New test.
            * g++.dg/plugin/plugin.exp (plugin_test_list): Add it,
            using the location_overflow_plugin.c from gcc.dg/plugin.

    libcpp/ChangeLog:
            PR preprocessor/96391
            * line-map.c (linemap_compare_locations): Require that
            the location be <= LINE_MAP_MAX_LOCATION_WITH_COLS when
            treating locations as coming from the same macro expansion.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10 Regression] ICE in linemap_compare_locations on "CONST VOID" in large C++ files
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (20 preceding siblings ...)
  2021-02-10 19:33 ` [Bug preprocessor/96391] [10/11 Regression] ICE in linemap_compare_locations on "CONST VOID" in large C++ files cvs-commit at gcc dot gnu.org
@ 2021-02-10 19:38 ` dmalcolm at gcc dot gnu.org
  2021-02-10 20:24 ` dmalcolm at gcc dot gnu.org
                   ` (8 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2021-02-10 19:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[10/11 Regression] ICE in   |[10 Regression] ICE in
                   |linemap_compare_locations   |linemap_compare_locations
                   |on "CONST VOID" in large    |on "CONST VOID" in large
                   |C++ files                   |C++ files

--- Comment #21 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Should be fixed on trunk by the above commit.  Presumably still affects gcc 10
branch.  Updating "Summary" accordingly.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10 Regression] ICE in linemap_compare_locations on "CONST VOID" in large C++ files
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (21 preceding siblings ...)
  2021-02-10 19:38 ` [Bug preprocessor/96391] [10 " dmalcolm at gcc dot gnu.org
@ 2021-02-10 20:24 ` dmalcolm at gcc dot gnu.org
  2021-02-10 23:32 ` qinzhao at gcc dot gnu.org
                   ` (7 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2021-02-10 20:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #22 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
*** Bug 96940 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10 Regression] ICE in linemap_compare_locations on "CONST VOID" in large C++ files
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (22 preceding siblings ...)
  2021-02-10 20:24 ` dmalcolm at gcc dot gnu.org
@ 2021-02-10 23:32 ` qinzhao at gcc dot gnu.org
  2021-04-08 12:02 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: qinzhao at gcc dot gnu.org @ 2021-02-10 23:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #23 from qinzhao at gcc dot gnu.org ---
with the latest gcc11, our application can be compiled without any issue now.
thanks a lot for fixing this bug.

will this patch be added to gcc10?

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10 Regression] ICE in linemap_compare_locations on "CONST VOID" in large C++ files
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (23 preceding siblings ...)
  2021-02-10 23:32 ` qinzhao at gcc dot gnu.org
@ 2021-04-08 12:02 ` rguenth at gcc dot gnu.org
  2021-06-16 15:41 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-08 12:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.3                        |10.4

--- Comment #24 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10.3 is being released, retargeting bugs to GCC 10.4.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10 Regression] ICE in linemap_compare_locations on "CONST VOID" in large C++ files
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (24 preceding siblings ...)
  2021-04-08 12:02 ` rguenth at gcc dot gnu.org
@ 2021-06-16 15:41 ` cvs-commit at gcc dot gnu.org
  2021-06-16 18:33 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-16 15:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #25 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:9e64426dae129cca5b62355ef6c5a3bd6137e830

commit r12-1538-g9e64426dae129cca5b62355ef6c5a3bd6137e830
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Jun 14 17:37:43 2021 -0400

    libcpp: location comparison within macro [PR100796]

    The patch for 96391 changed linemap_compare_locations to give up on
    comparing locations from macro expansions if we don't have column
    information.  But in this testcase, the BOILERPLATE macro is multiple lines
    long, so we do want to compare locations within the macro.  So this patch
    moves the LINE_MAP_MAX_LOCATION_WITH_COLS check inside the block, to use it
    for failing gracefully.

            PR c++/100796
            PR preprocessor/96391

    libcpp/ChangeLog:

            * line-map.c (linemap_compare_locations): Only use comparison with
            LINE_MAP_MAX_LOCATION_WITH_COLS to avoid abort.

    gcc/testsuite/ChangeLog:

            * g++.dg/plugin/location-overflow-test-pr100796.c: New test.
            * g++.dg/plugin/plugin.exp: Run it.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10 Regression] ICE in linemap_compare_locations on "CONST VOID" in large C++ files
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (25 preceding siblings ...)
  2021-06-16 15:41 ` cvs-commit at gcc dot gnu.org
@ 2021-06-16 18:33 ` cvs-commit at gcc dot gnu.org
  2022-01-25 20:05 ` mike at cchtml dot com
                   ` (3 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-16 18:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #26 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:bb2e908638758097e261bca1a4825d171a18af9c

commit r11-8583-gbb2e908638758097e261bca1a4825d171a18af9c
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Jun 14 17:37:43 2021 -0400

    libcpp: location comparison within macro [PR100796]

    The patch for 96391 changed linemap_compare_locations to give up on
    comparing locations from macro expansions if we don't have column
    information.  But in this testcase, the BOILERPLATE macro is multiple lines
    long, so we do want to compare locations within the macro.  So this patch
    moves the LINE_MAP_MAX_LOCATION_WITH_COLS check inside the block, to use it
    for failing gracefully.

            PR c++/100796
            PR preprocessor/96391

    libcpp/ChangeLog:

            * line-map.c (linemap_compare_locations): Only use comparison with
            LINE_MAP_MAX_LOCATION_WITH_COLS to avoid abort.

    gcc/testsuite/ChangeLog:

            * g++.dg/plugin/location-overflow-test-pr100796.c: New test.
            * g++.dg/plugin/plugin.exp: Run it.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10 Regression] ICE in linemap_compare_locations on "CONST VOID" in large C++ files
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (26 preceding siblings ...)
  2021-06-16 18:33 ` cvs-commit at gcc dot gnu.org
@ 2022-01-25 20:05 ` mike at cchtml dot com
  2022-01-26  7:05 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: mike at cchtml dot com @ 2022-01-25 20:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #27 from Michael Cronenworth <mike at cchtml dot com> ---
I can also say that gcc 11 has fixed this. Thanks. I'm happy to close as I will
not be using 10.x anymore.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10 Regression] ICE in linemap_compare_locations on "CONST VOID" in large C++ files
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (27 preceding siblings ...)
  2022-01-25 20:05 ` mike at cchtml dot com
@ 2022-01-26  7:05 ` rguenth at gcc dot gnu.org
  2022-06-28 10:41 ` jakub at gcc dot gnu.org
  2023-07-07  8:59 ` rguenth at gcc dot gnu.org
  30 siblings, 0 replies; 32+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-26  7:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

--- Comment #28 from Richard Biener <rguenth at gcc dot gnu.org> ---
The patch should be further backported if it doesn't cause any issues.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10 Regression] ICE in linemap_compare_locations on "CONST VOID" in large C++ files
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (28 preceding siblings ...)
  2022-01-26  7:05 ` rguenth at gcc dot gnu.org
@ 2022-06-28 10:41 ` jakub at gcc dot gnu.org
  2023-07-07  8:59 ` rguenth at gcc dot gnu.org
  30 siblings, 0 replies; 32+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.4                        |10.5

--- Comment #29 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Bug preprocessor/96391] [10 Regression] ICE in linemap_compare_locations on "CONST VOID" in large C++ files
  2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
                   ` (29 preceding siblings ...)
  2022-06-28 10:41 ` jakub at gcc dot gnu.org
@ 2023-07-07  8:59 ` rguenth at gcc dot gnu.org
  30 siblings, 0 replies; 32+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07  8:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96391

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |10.5.0
   Target Milestone|10.5                        |11.0
      Known to work|                            |11.1.0
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #30 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed in GCC 11.

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2023-07-07  8:59 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-30 15:51 [Bug c++/96391] New: internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359 mike at cchtml dot com
2020-07-30 15:52 ` [Bug c++/96391] " mike at cchtml dot com
2020-07-31  6:15 ` [Bug preprocessor/96391] [10/11 Regression] " rguenth at gcc dot gnu.org
2020-07-31  6:18 ` marxin at gcc dot gnu.org
2020-07-31 18:13 ` mike at cchtml dot com
2020-09-04 17:50 ` jan.smets at nokia dot com
2020-10-07 19:46 ` qinzhao at gcc dot gnu.org
2020-10-09 16:48 ` qinzhao at gcc dot gnu.org
2020-10-09 16:49 ` qinzhao at gcc dot gnu.org
2020-12-06  3:18 ` mike at cchtml dot com
2021-02-09  0:10 ` dmalcolm at gcc dot gnu.org
2021-02-09  7:06 ` jan.smets at nokia dot com
2021-02-09 14:40 ` dmalcolm at gcc dot gnu.org
2021-02-10  0:04 ` mike at cchtml dot com
2021-02-10 11:42 ` dmalcolm at gcc dot gnu.org
2021-02-10 12:15 ` dmalcolm at gcc dot gnu.org
2021-02-10 15:05 ` dmalcolm at gcc dot gnu.org
2021-02-10 15:57 ` rguenther at suse dot de
2021-02-10 16:08 ` qinzhao at gcc dot gnu.org
2021-02-10 16:57 ` dmalcolm at gcc dot gnu.org
2021-02-10 16:58 ` dmalcolm at gcc dot gnu.org
2021-02-10 19:33 ` [Bug preprocessor/96391] [10/11 Regression] ICE in linemap_compare_locations on "CONST VOID" in large C++ files cvs-commit at gcc dot gnu.org
2021-02-10 19:38 ` [Bug preprocessor/96391] [10 " dmalcolm at gcc dot gnu.org
2021-02-10 20:24 ` dmalcolm at gcc dot gnu.org
2021-02-10 23:32 ` qinzhao at gcc dot gnu.org
2021-04-08 12:02 ` rguenth at gcc dot gnu.org
2021-06-16 15:41 ` cvs-commit at gcc dot gnu.org
2021-06-16 18:33 ` cvs-commit at gcc dot gnu.org
2022-01-25 20:05 ` mike at cchtml dot com
2022-01-26  7:05 ` rguenth at gcc dot gnu.org
2022-06-28 10:41 ` jakub at gcc dot gnu.org
2023-07-07  8:59 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).