public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug preprocessor/96391] [10/11 Regression] internal compiler error: in linemap_compare_locations, at libcpp/line-map.c:1359
Date: Wed, 10 Feb 2021 15:57:20 +0000	[thread overview]
Message-ID: <bug-96391-4-wS6y8Qefgu@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-96391-4@http.gcc.gnu.org/bugzilla/>

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.

  parent reply	other threads:[~2021-02-10 15:57 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-30 15:51 [Bug c++/96391] New: " 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-96391-4-wS6y8Qefgu@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).