This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/81705] New: UBSAN: yet another false positive
- From: "babokin at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 03 Aug 2017 19:11:23 +0000
- Subject: [Bug tree-optimization/81705] New: UBSAN: yet another false positive
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81705
Bug ID: 81705
Summary: UBSAN: yet another false positive
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: babokin at gmail dot com
Target Milestone: ---
gcc trunk, rev250857, x86_64.
After recent fix for #81148, this case is the last one failing UBSAN false
positive that I see on my radars.
> cat f.cpp
int var_4 = -1716607962;
int var_14 = 943738830;
volatile int a;
int main() {
// (-(-1716607962) - 516151698) - -(9403738830)
a = (-var_4 - 516151698) - -var_14;
return 0;
}
> g++ -fsanitize=undefined f.cpp -o out; ./out
f.cpp:6:28: runtime error: signed integer overflow: -943738830 + -1716607962
cannot be represented in type 'int'
f.cpp:6:28: runtime error: signed integer overflow: -516151698 - 1634620504
cannot be represented in type 'int'