[Bug tree-optimization/78327] Improve VRP for ranges of signed integers in the range [-TYPE_MAX + N, N]

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Nov 12 03:44:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78327

--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> ---
In your test case the int variable isn't in the [-TYPE_MAX + N, N] range which
is the one that triggers the bug/limitation (that's why I'd like to keep it in
the summary).  The following test case shows the problem with int for N = 2.

void f (void*);

void g (int n)
{
  if (n < -__INT_MAX__ + 2 || 2 < n) n = 0;

  f (__builtin_alloca (__INT_MAX__ + 1LU + n));
}


More information about the Gcc-bugs mailing list