[Bug sanitizer/80347] New: UBSAN: compiler time crash in ubsan_instrument_division

babokin at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Apr 6 23:15:00 GMT 2017


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

            Bug ID: 80347
           Summary: UBSAN: compiler time crash in
                    ubsan_instrument_division
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: babokin at gmail dot com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
  Target Milestone: ---

Top of the trunk gcc on x86_64

> cat f.cpp
void foo() {
  if (0)
    unsigned((0 != 60806) > (0 != 0)) / 0;
}

> g++ -fsanitize=undefined -w -O0 -c f.cpp
f.cpp: In function ‘void foo()’:
f.cpp:3:41: internal compiler error: in ubsan_instrument_division, at
c-family/c-ubsan.c:46
     unsigned((0 != 60806) > (0 != 0)) / 0;
                                         ^
0x8d5ffb ubsan_instrument_division(unsigned int, tree_node*, tree_node*)
        ../../gcc/gcc/c-family/c-ubsan.c:45
0x76d95a cp_build_binary_op(unsigned int, tree_code, tree_node*, tree_node*,
int)
        ../../gcc/gcc/cp/typeck.c:5226
0x6158b4 build_new_op_1
        ../../gcc/gcc/cp/call.c:5982
0x61635e build_new_op(unsigned int, tree_code, int, tree_node*, tree_node*,
tree_node*, tree_node**, int)
        ../../gcc/gcc/cp/call.c:6026
0x75e622 build_x_binary_op(unsigned int, tree_code, tree_node*, tree_code,
tree_node*, tree_code, tree_node**, int)
        ../../gcc/gcc/cp/typeck.c:3928
<...>


More information about the Gcc-bugs mailing list