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

            Bug ID: 68839
           Summary: [6 regression] ICE in contains_point at
                    diagnostic-show-locus.c:340
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

Compiling the example from the documentation of the -Wduplicated-cond option in
the GCC manual triggers the following ICE:

$ cat a.c && /build/gcc-trunk-svn/gcc/xgcc -B /build/gcc-trunk-svn/gcc -S
-Wduplicated-cond a.c
struct S { void *q; };

#define NULL (void*)0

void f (struct S *p)
{
    if (p->q != NULL) { }
    else if (p->q != NULL) { }
}


a.c: In function ‘f’:
a.c:8:19: warning: duplicated ‘if’ condition [-Wduplicated-cond]

a.c:9:1: internal compiler error: in contains_point, at
diagnostic-show-locus.c:340
 }
 ^

0x17b3160 contains_point
        /home/msebor/scm/fsf/gcc-svn/gcc/diagnostic-show-locus.c:340
0x17b3bf4 get_state_at_point
        /home/msebor/scm/fsf/gcc-svn/gcc/diagnostic-show-locus.c:684
0x17b36b4 print_source_line
        /home/msebor/scm/fsf/gcc-svn/gcc/diagnostic-show-locus.c:538
0x17b3f07 diagnostic_show_locus(diagnostic_context*, diagnostic_info const*)
        /home/msebor/scm/fsf/gcc-svn/gcc/diagnostic-show-locus.c:803
0x81e188 c_diagnostic_finalizer
        /home/msebor/scm/fsf/gcc-svn/gcc/c-family/c-opts.c:167
0x17b0d0a diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
        /home/msebor/scm/fsf/gcc-svn/gcc/diagnostic.c:800
0x17b1910 warning_at(unsigned int, int, char const*, ...)
        /home/msebor/scm/fsf/gcc-svn/gcc/diagnostic.c:1029
0x801c7c warn_duplicated_cond_add_or_warn(unsigned int, tree_node*,
vec<tree_node*, va_heap, vl_ptr>**)
        /home/msebor/scm/fsf/gcc-svn/gcc/c-family/c-common.c:12617
0x7864c6 c_parser_if_statement
        /home/msebor/scm/fsf/gcc-svn/gcc/c/c-parser.c:5352
0x785903 c_parser_statement_after_labels
        /home/msebor/scm/fsf/gcc-svn/gcc/c/c-parser.c:5033
0x7862cc c_parser_else_body
        /home/msebor/scm/fsf/gcc-svn/gcc/c/c-parser.c:5306
0x7865fa c_parser_if_statement
        /home/msebor/scm/fsf/gcc-svn/gcc/c/c-parser.c:5378
0x785903 c_parser_statement_after_labels
        /home/msebor/scm/fsf/gcc-svn/gcc/c/c-parser.c:5033
0x78539c c_parser_compound_statement_nostart
        /home/msebor/scm/fsf/gcc-svn/gcc/c/c-parser.c:4763
0x784da4 c_parser_compound_statement
        /home/msebor/scm/fsf/gcc-svn/gcc/c/c-parser.c:4599
0x77fb71 c_parser_declaration_or_fndef
        /home/msebor/scm/fsf/gcc-svn/gcc/c/c-parser.c:2017
0x77e631 c_parser_external_declaration
        /home/msebor/scm/fsf/gcc-svn/gcc/c/c-parser.c:1461
0x77e23b c_parser_translation_unit
        /home/msebor/scm/fsf/gcc-svn/gcc/c/c-parser.c:1348
0x7afed2 c_parse_file()
        /home/msebor/scm/fsf/gcc-svn/gcc/c/c-parser.c:17736
0x81fd4a c_common_parse_file()
        /home/msebor/scm/fsf/gcc-svn/gcc/c-family/c-opts.c:1064
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

Reply via email to