This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/80403] New: UBSAN: compile time crash with "type mismatch in binary expression" message in / and % expr
- From: "babokin at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 11 Apr 2017 23:36:42 +0000
- Subject: [Bug sanitizer/80403] New: UBSAN: compile time crash with "type mismatch in binary expression" message in / and % expr
- Auto-submitted: auto-generated
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