public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/100142] New: [11 Regression] ICE in linemap_position_for_loc_and_offset, at libcpp/line-map.c:1004
@ 2021-04-19  7:15 asolokha at gmx dot com
  2021-04-19  7:24 ` [Bug preprocessor/100142] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: asolokha at gmx dot com @ 2021-04-19  7:15 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100142
           Summary: [11 Regression] ICE in
                    linemap_position_for_loc_and_offset, at
                    libcpp/line-map.c:1004
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc-11.0.1-alpha20210418 snapshot (g:b412ce8e961052e6becea3bc783a53e1d5feaa0f)
ICEs when compiling the following testcase w/ -fpreprocessed:

void
foo (void)
{
  assert (1);
}

% gcc-11.0.1 -c a14n5g3n.i
a14n5g3n.i: In function 'foo':
a14n5g3n.i:4:3: warning: implicit declaration of function 'assert'
[-Wimplicit-function-declaration]
    4 |   assert (1);
      |   ^~~~~~
a14n5g3n.i:4:3: internal compiler error: in
linemap_position_for_loc_and_offset, at libcpp/line-map.c:1004
0x1a48cb0 linemap_position_for_loc_and_offset(line_maps*, unsigned int,
unsigned int)
       
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210418/work/gcc-11-20210418/libcpp/line-map.c:1004
0x8b3004 try_to_locate_new_include_insertion_point
       
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210418/work/gcc-11-20210418/gcc/c-family/c-common.c:8961
0x8b3004 maybe_add_include_fixit(rich_location*, char const*, bool)
       
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210418/work/gcc-11-20210418/gcc/c-family/c-common.c:9014
0x8ec9d2 suggest_missing_header::~suggest_missing_header()
       
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210418/work/gcc-11-20210418/gcc/c-family/known-headers.cc:300
0x8eca4d suggest_missing_header::~suggest_missing_header()
       
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210418/work/gcc-11-20210418/gcc/c-family/known-headers.cc:294
0x8eca4d suggest_missing_header::~suggest_missing_header()
       
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210418/work/gcc-11-20210418/gcc/c-family/known-headers.cc:305
0x7fa1eb
std::default_delete<deferred_diagnostic>::operator()(deferred_diagnostic*)
const
       
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210418/work/gcc-11-20210418/libstdc++-v3/include/bits/unique_ptr.h:85
0x7fa1eb std::unique_ptr<deferred_diagnostic,
std::default_delete<deferred_diagnostic> >::~unique_ptr()
       
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210418/work/gcc-11-20210418/libstdc++-v3/include/bits/unique_ptr.h:361
0x7fa1eb name_hint::~name_hint()
       
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210418/work/gcc-11-20210418/gcc/c-family/name-hint.h:91
0x7fa1eb implicit_decl_warning
       
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210418/work/gcc-11-20210418/gcc/c/c-decl.c:3414
0x7fa44d implicit_decl_warning
       
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210418/work/gcc-11-20210418/gcc/c/c-decl.c:3350
0x7fa44d implicitly_declare(unsigned int, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210418/work/gcc-11-20210418/gcc/c/c-decl.c:3714
0x814a57 build_external_ref(unsigned int, tree_node*, bool, tree_node**)
       
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210418/work/gcc-11-20210418/gcc/c/c-typeck.c:2835
0x84cd2a c_parser_postfix_expression
       
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210418/work/gcc-11-20210418/gcc/c/c-parser.c:9005
0x850a8a c_parser_unary_expression
       
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210418/work/gcc-11-20210418/gcc/c/c-parser.c:8224
0x8522bb c_parser_cast_expression
       
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210418/work/gcc-11-20210418/gcc/c/c-parser.c:8066
0x852564 c_parser_binary_expression
       
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210418/work/gcc-11-20210418/gcc/c/c-parser.c:7869
0x8538e8 c_parser_conditional_expression
       
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210418/work/gcc-11-20210418/gcc/c/c-parser.c:7592
0x853fe4 c_parser_expr_no_commas
       
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210418/work/gcc-11-20210418/gcc/c/c-parser.c:7507
0x854295 c_parser_expression
       
/var/tmp/portage/sys-devel/gcc-11.0.1_alpha20210418/work/gcc-11-20210418/gcc/c/c-parser.c:10600

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

* [Bug preprocessor/100142] [11 Regression] ICE in linemap_position_for_loc_and_offset, at libcpp/line-map.c:1004
  2021-04-19  7:15 [Bug preprocessor/100142] New: [11 Regression] ICE in linemap_position_for_loc_and_offset, at libcpp/line-map.c:1004 asolokha at gmx dot com
@ 2021-04-19  7:24 ` rguenth at gcc dot gnu.org
  2021-04-19  7:26 ` marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-19  7:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
     Ever confirmed|0                           |1
   Target Milestone|---                         |11.0
   Last reconfirmed|                            |2021-04-19
             Status|UNCONFIRMED                 |NEW
           Priority|P3                          |P1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  Seems to be a quite recent regression.

1001      location_t r = 
1002        linemap_position_for_line_and_column (set, map, line, column);
1003      if (linemap_assert_fails (r <= set->highest_location)
1004          || linemap_assert_fails (map == linemap_lookup (set, r)))
1005        return loc;

the map == linemap_lookup (set, r) part fails.

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

* [Bug preprocessor/100142] [11 Regression] ICE in linemap_position_for_loc_and_offset, at libcpp/line-map.c:1004
  2021-04-19  7:15 [Bug preprocessor/100142] New: [11 Regression] ICE in linemap_position_for_loc_and_offset, at libcpp/line-map.c:1004 asolokha at gmx dot com
  2021-04-19  7:24 ` [Bug preprocessor/100142] " rguenth at gcc dot gnu.org
@ 2021-04-19  7:26 ` marxin at gcc dot gnu.org
  2021-04-19  7:37 ` [Bug preprocessor/100142] [11 Regression] ICE in linemap_position_for_loc_and_offset, at libcpp/line-map.c:1004 since r11-8150-g4acb3af3669db4ca rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-04-19  7:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed, started with r11-8150-g4acb3af3669db4ca.

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

* [Bug preprocessor/100142] [11 Regression] ICE in linemap_position_for_loc_and_offset, at libcpp/line-map.c:1004 since r11-8150-g4acb3af3669db4ca
  2021-04-19  7:15 [Bug preprocessor/100142] New: [11 Regression] ICE in linemap_position_for_loc_and_offset, at libcpp/line-map.c:1004 asolokha at gmx dot com
  2021-04-19  7:24 ` [Bug preprocessor/100142] " rguenth at gcc dot gnu.org
  2021-04-19  7:26 ` marxin at gcc dot gnu.org
@ 2021-04-19  7:37 ` rguenth at gcc dot gnu.org
  2021-04-19 12:43 ` cvs-commit at gcc dot gnu.org
  2021-04-19 12:44 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-19  7:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
diff --git a/libcpp/line-map.c b/libcpp/line-map.c
index 2f5e44447d2..a03d6760a8e 100644
--- a/libcpp/line-map.c
+++ b/libcpp/line-map.c
@@ -982,7 +982,7 @@ linemap_position_for_loc_and_offset (line_maps *set,
      the next line map of the set.  Otherwise, we try to encode the
      location in the next map.  */
   for (; map != LINEMAPS_LAST_ORDINARY_MAP (set)
-        && (loc + (column << map->m_range_bits)
+        && (loc + (column_offset << map->m_range_bits)
             >= MAP_START_LOCATION (map + 1)); map++)
     /* If the next map is a different file, or starts in a higher line, we
        cannot encode the location there.  */

fixes it (pasto in original fix?) and seems to preserve fixing the original PR
(but that had no testcase added).

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

* [Bug preprocessor/100142] [11 Regression] ICE in linemap_position_for_loc_and_offset, at libcpp/line-map.c:1004 since r11-8150-g4acb3af3669db4ca
  2021-04-19  7:15 [Bug preprocessor/100142] New: [11 Regression] ICE in linemap_position_for_loc_and_offset, at libcpp/line-map.c:1004 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2021-04-19  7:37 ` [Bug preprocessor/100142] [11 Regression] ICE in linemap_position_for_loc_and_offset, at libcpp/line-map.c:1004 since r11-8150-g4acb3af3669db4ca rguenth at gcc dot gnu.org
@ 2021-04-19 12:43 ` cvs-commit at gcc dot gnu.org
  2021-04-19 12:44 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-19 12:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:2f422b550ff6351d312e6c81a00b488d9280bfff

commit r11-8243-g2f422b550ff6351d312e6c81a00b488d9280bfff
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Apr 19 10:07:35 2021 +0200

    preprocessor/100142  - revert unwanted change in last commit

    This reverts a s/column_offset/column/ change in the fix for PR99446.

    2021-04-19  Richard Biener  <rguenther@suse.de>

            PR preprocessor/100142
    libcpp/
            * line-map.c (linemap_position_for_loc_and_offset): Revert
            unintended s/column_offset/column/ change.

    gcc/testsuite/
            * gcc.dg/pr100142.c: New testcase.
            * g++.dg/diagnostic/pr72803.C: Revert last change.

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

* [Bug preprocessor/100142] [11 Regression] ICE in linemap_position_for_loc_and_offset, at libcpp/line-map.c:1004 since r11-8150-g4acb3af3669db4ca
  2021-04-19  7:15 [Bug preprocessor/100142] New: [11 Regression] ICE in linemap_position_for_loc_and_offset, at libcpp/line-map.c:1004 asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2021-04-19 12:43 ` cvs-commit at gcc dot gnu.org
@ 2021-04-19 12:44 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-19 12:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2021-04-19 12:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-19  7:15 [Bug preprocessor/100142] New: [11 Regression] ICE in linemap_position_for_loc_and_offset, at libcpp/line-map.c:1004 asolokha at gmx dot com
2021-04-19  7:24 ` [Bug preprocessor/100142] " rguenth at gcc dot gnu.org
2021-04-19  7:26 ` marxin at gcc dot gnu.org
2021-04-19  7:37 ` [Bug preprocessor/100142] [11 Regression] ICE in linemap_position_for_loc_and_offset, at libcpp/line-map.c:1004 since r11-8150-g4acb3af3669db4ca rguenth at gcc dot gnu.org
2021-04-19 12:43 ` cvs-commit at gcc dot gnu.org
2021-04-19 12:44 ` 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).