https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85789
Bug ID: 85789
Summary: Signed integer overflow with nonzero optimization in
cse.c
Product: gcc
Version: 9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: zeccav at gmail dot com
Target Milestone: ---
Host: x86_64-pc-linux-gnu
// Signed integer overflow in sanitized version of gcc trunk 260152
// Taken from testcase pr82596.c
// Must be compiled with nonzero optimization
// ../../gcc/gcc/cse.c:2194:34: runtime error: signed integer overflow: 1 -
-9223372036854775807 cannot be represented in type 'long int'
//
#define SSIZE_MAX __PTRDIFF_MAX__
#define SSIZE_MIN (-SSIZE_MAX - 1)
void s (int, ...);
void test (int i)
{
s (""[SSIZE_MIN + 1]);
s (""[1]);
}