This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/79199] New: ICE with -Wduplicated-branches


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

            Bug ID: 79199
           Summary: ICE with -Wduplicated-branches
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sirl at gcc dot gnu.org
  Target Milestone: ---

This creduce'd testcase crashes with -Wduplicated-branches (trunk r244773).

unsigned int a, b, c, d, e;
void fn1(void) {
  if (0) {
    if (d > 4294967293)
      (void) 5;
    c = d;
    b = e | a;
  } else {
    if (d > 4294967293)
      (void) 5;
    c = d;
    b = e | a;
  }
}

# gcc-trunk -S -fpreprocessed -Wduplicated-branches -xc testcase.i -W -Wall
testcase.i: In function 'fn1':
testcase.i:14:1: internal compiler error: Segmentation fault
 }
 ^
0x9d70af crash_signal
        ../../gcc/toplev.c:333
0x6d6bda operand_equal_p(tree_node const*, tree_node const*, unsigned int)
        ../../gcc/fold-const.c:2761
0x6d9332 operand_equal_p(tree_node const*, tree_node const*, unsigned int)
        ../../gcc/fold-const.c:3150
0x6d6e17 operand_equal_p(tree_node const*, tree_node const*, unsigned int)
        ../../gcc/fold-const.c:2743
0x6d7880 operand_equal_p(tree_node const*, tree_node const*, unsigned int)
        ../../gcc/fold-const.c:3307
0x6d6e17 operand_equal_p(tree_node const*, tree_node const*, unsigned int)
        ../../gcc/fold-const.c:2743
0x554251 do_warn_duplicated_branches
        ../../gcc/c-family/c-warn.c:2270
0x554251 do_warn_duplicated_branches_r(tree_node**, int*, void*)
        ../../gcc/c-family/c-warn.c:2287
0xc99343 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, default_hash_traits<tree_node*> >*, tree_node*
(*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*,
hash_set<tree_node*, default_hash_traits<tree_node*> >*))
        ../../gcc/tree.c:11795
0xc98e90 walk_tree_without_duplicates_1(tree_node**, tree_node*
(*)(tree_node**, int*, void*), void*, tree_node* (*)(tree_node**, int*,
tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*,
default_hash_traits<tree_node*> >*))
        ../../gcc/tree.c:12138
0x517d12 c_genericize(tree_node*)
        ../../gcc/c-family/c-gimplify.c:129
0x450ebc finish_function()
        ../../gcc/c/c-decl.c:9361
0x4bf0fa c_parser_declaration_or_fndef
        ../../gcc/c/c-parser.c:2110
0x4c6fb3 c_parser_external_declaration
        ../../gcc/c/c-parser.c:1463
0x4c7a29 c_parser_translation_unit
        ../../gcc/c/c-parser.c:1344
0x4c7a29 c_parse_file()
        ../../gcc/c/c-parser.c:18156
0x524bb3 c_common_parse_file()
        ../../gcc/c-family/c-opts.c:1107
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://bugs.opensuse.org/> for instructions.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]