]> git.ipfire.org Git - thirdparty/gcc.git/commit
Change integral divide by zero to produce UNDEFINED.
authorAndrew MacLeod <amacleod@redhat.com>
Wed, 28 Jul 2021 17:14:22 +0000 (13:14 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Fri, 30 Jul 2021 19:10:48 +0000 (15:10 -0400)
commitebbcdd7fae1f802763850e4afedfdfa09cf10e1a
treecf21f2d2140b00303b24119cd93ad5190d43c009
parentd242acc396d645267cd1ccbdb4d0d73cc9b1ef48
Change integral divide by zero to produce UNDEFINED.

Instead of VARYING, we can get better results by treating divide by zero
as producing an undefined result.

gcc/
* range-op.cc (operator_div::wi_fold): Return UNDEFINED for [0, 0] divisor.

gcc/testsuite/
* gcc.dg/tree-ssa/pr61839_2.c: Adjust.
gcc/range-op.cc
gcc/testsuite/gcc.dg/tree-ssa/pr61839_2.c