public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] VRP: Treat all divisions by zero as VR_UNDEFINED.
@ 2018-09-11 10:18 Aldy Hernandez
  0 siblings, 0 replies; only message in thread
From: Aldy Hernandez @ 2018-09-11 10:18 UTC (permalink / raw)
  To: gcc-patches

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

Doing this was approved by Richi at some point when I rewrote the 
division code.  I finally got around to testing it.

Committed.

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

gcc/

	* tree-vrp (extract_range_from_binary_expr_1): Treat all divisions
	by zero as VR_UNDEFINED.

diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 8f16713300c..a82cf3e36c1 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -1601,12 +1601,7 @@ extract_range_from_binary_expr_1 (value_range *vr,
       /* Special case explicit division by zero as undefined.  */
       if (range_is_null (&vr1))
 	{
-	  /* However, we must not eliminate a division by zero if
-	     flag_non_call_exceptions.  */
-	  if (cfun->can_throw_non_call_exceptions)
-	    set_value_range_to_varying (vr);
-	  else
-	    set_value_range_to_undefined (vr);
+	  set_value_range_to_undefined (vr);
 	  return;
 	}
 

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

only message in thread, other threads:[~2018-09-11 10:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-11 10:18 [committed] VRP: Treat all divisions by zero as VR_UNDEFINED Aldy Hernandez

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).