This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/80403] 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: Wed, 12 Apr 2017 21:38:10 +0000
- Subject: [Bug sanitizer/80403] UBSAN: compile time crash with "type mismatch in binary expression" message in / and % expr
- Auto-submitted: auto-generated
- References: <bug-80403-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80403
--- Comment #8 from Dmitry Babokin <babokin at gmail dot com> ---
Three errors in one test case. GCC r246882.
> cat f.cpp
extern const long long int var_7;
extern unsigned long int var_59;
int foo() {
int a = (0 - 40U <= (0 == 8)) << !var_59 << (0 < var_7) == 0;
int b = ((0 ^ 0) < long(1066066618772207110 <= 0)) / 0 << 0;
return a+b;
}
> g++ -w -fsanitize=undefined -O0 -c f.cpp
f.cpp: In function ‘int foo()’:
f.cpp:3:5: error: mismatching comparison operand types
int foo() {
^~~
unsigned int
int
_4 = D.2761 < 0;
f.cpp:3:5: error: type mismatch in shift expression
int
unsigned int
int
_19 = D.2761 << _18;
f.cpp:3:5: error: type mismatch in binary expression
int
long int
int
D.2772 = 0 / 0;
f.cpp:3:5: internal compiler error: verify_gimple failed