public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Change x mod 0 to undefined.
@ 2021-05-07 19:02 Andrew MacLeod
  0 siblings, 0 replies; only message in thread
From: Andrew MacLeod @ 2021-05-07 19:02 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 148 bytes --]

We were setting x % 0 to varying...  change it to undefined.

Bootstraps on  x86_64-pc-linux-gnu with no testsuite regressions.

Pushed.

Andrew


[-- Attachment #2: 2-mod.patch --]
[-- Type: text/x-patch, Size: 632 bytes --]

commit 2262206b82da0ab4050fe6168a7d09be4e4b3d0f
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Mon Apr 26 17:46:31 2021 -0400

    Change x mod 0 to produce UNDEFINED rather than VARYING.
    
            * range-ops.cc (operator_trunc_mod::wi_fold): x % 0 is UNDEFINED.

diff --git a/gcc/range-op.cc b/gcc/range-op.cc
index 0027b3e1427..ab8f4e211ac 100644
--- a/gcc/range-op.cc
+++ b/gcc/range-op.cc
@@ -2689,7 +2689,7 @@ operator_trunc_mod::wi_fold (irange &r, tree type,
   // Mod 0 is undefined.
   if (wi_zero_p (type, rh_lb, rh_ub))
     {
-      r.set_varying (type);
+      r.set_undefined ();
       return;
     }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-07 19:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-07 19:02 [PATCH] Change x mod 0 to undefined Andrew MacLeod

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).