[Bug middle-end/108256] New: Missing integer overflow instrumentation when assignment LHS is narrow
amonakov at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Dec 31 15:12:09 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108256
Bug ID: 108256
Summary: Missing integer overflow instrumentation when
assignment LHS is narrow
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: amonakov at gcc dot gnu.org
Target Milestone: ---
For
unsigned short f(unsigned short x, unsigned short y)
{
return x * y;
}
unsigned short g(unsigned short x, unsigned short y)
{
int r = x * y;
return r;
}
gcc -O2 -fsanitize=undefined emits instrumentation only for 'g', although both
are equivalent. When 'int r' is changed to 'unsigned short r', 'g' is also not
instrumented.
PR 107912 shows a slightly more complicated variant of this. Affects both C and
C++.
More information about the Gcc-bugs
mailing list