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 sanitizer/80403] New: UBSAN: compile time crash with "type mismatch in binary expression" message in / and % expr


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

            Bug ID: 80403
           Summary: UBSAN: compile time crash with "type mismatch in
                    binary expression" message in / and % expr
           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: ---

gcc x86_64, top of the trunk with patch from 80349. This seems related, but
different.

> cat f.cpp
unsigned foo() {
   unsigned a = unsigned(!(6044238 >> 0) >= (0 < 0)) % 0;
   unsigned b = unsigned(!(6044238 >> 0) >= (0 < 0)) / 0;
   return a+b;
}

> g++ -fsanitize=undefined -w -O0 -c f.cpp
f.cpp: In function ‘unsigned int foo()’:
f.cpp:1:10: error: type mismatch in binary expression
 unsigned foo() {
          ^~~
unsigned int

int

unsigned int

a = 1 % 0;
f.cpp:1:10: error: type mismatch in binary expression
unsigned int

int

unsigned int

b = 1 / 0;
f.cpp:1:10: internal compiler error: verify_gimple failed

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