Bug 98294 - [11/12/13/14/15 Regression] ICE in calculate_line_spans, at diagnostic-show-locus.c:1296 since r6-6901-g876217ae71cf0b34
Summary: [11/12/13/14/15 Regression] ICE in calculate_line_spans, at diagnostic-show-l...
Status: ASSIGNED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 11.0
: P2 normal
Target Milestone: 11.5
Assignee: David Malcolm
URL:
Keywords: ice-checking, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2020-12-15 17:20 UTC by G. Steinmetz
Modified: 2024-04-26 10:39 UTC (History)
3 users (show)

See Also:
Host:
Target: x86_64-pc-linux-gnu
Build:
Known to work: 5.5.0
Known to fail: 6.1.0
Last reconfirmed: 2020-12-16 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description G. Steinmetz 2020-12-15 17:20:03 UTC
Old stuff, affects versions down to r6 :


$ cat z1.c
void f ()
{
  #line 9223372036854775807
  g ()
  + 1;
}


$ gcc-11-20201213 -c z1.c -Wall
z1.c: In function 'f':
z1.c:3:9: warning: line number out of range
    3 |   #line 9223372036854775807
      |         ^~~~~~~~~~~~~~~~~~~
z1.c:-1:3: warning: implicit declaration of function 'g' [-Wimplicit-function-declaration]
z1.c: warning: value computed is not used [-Wunused-value]

z1.c: internal compiler error: in calculate_line_spans, at diagnostic-show-locus.c:1296
0x1532394 calculate_line_spans
        ../../gcc/diagnostic-show-locus.c:1296
0x1532394 layout
        ../../gcc/diagnostic-show-locus.c:1003
0x1532572 diagnostic_show_locus(diagnostic_context*, rich_location*, diagnostic_t)
        ../../gcc/diagnostic-show-locus.c:2601
0x6e2435 c_diagnostic_finalizer
        ../../gcc/c-family/c-opts.c:174
0x152d744 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
        ../../gcc/diagnostic.c:1223
0x152de6e diagnostic_impl
        ../../gcc/diagnostic.c:1366
0x152e392 warning_at(unsigned int, int, char const*, ...)
        ../../gcc/diagnostic.c:1503
0x64ea89 c_process_expr_stmt(unsigned int, tree_node*)
        ../../gcc/c/c-typeck.c:11213
0x64eb8d c_finish_expr_stmt(unsigned int, tree_node*)
        ../../gcc/c/c-typeck.c:11243
0x689d18 c_parser_statement_after_labels
        ../../gcc/c/c-parser.c:6249
0x68bd0a c_parser_compound_statement_nostart
        ../../gcc/c/c-parser.c:5788
0x68c583 c_parser_compound_statement
        ../../gcc/c/c-parser.c:5597
0x68de38 c_parser_declaration_or_fndef
        ../../gcc/c/c-parser.c:2539
0x694ca7 c_parser_external_declaration
        ../../gcc/c/c-parser.c:1777
0x6957c9 c_parser_translation_unit
        ../../gcc/c/c-parser.c:1650
0x6957c9 c_parse_file()
        ../../gcc/c/c-parser.c:21929
0x6e5532 c_common_parse_file()
        ../../gcc/c-family/c-opts.c:1211
Comment 1 Martin Liška 2020-12-16 08:21:11 UTC
Confirmed, started with r6-6901-g876217ae71cf0b34.
Comment 2 Jakub Jelinek 2021-01-28 09:39:47 UTC
David, do you think you could have a look?
Comment 3 Richard Biener 2021-06-01 08:19:12 UTC
GCC 9.4 is being released, retargeting bugs to GCC 9.5.
Comment 4 Richard Biener 2022-05-27 09:44:03 UTC
GCC 9 branch is being closed
Comment 5 Jakub Jelinek 2022-06-28 10:42:52 UTC
GCC 10.4 is being released, retargeting bugs to GCC 10.5.
Comment 6 Richard Biener 2023-07-07 10:38:41 UTC
GCC 10 branch is being closed.