public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aldyh/heads/ranger-staging)] parity with evrp.
@ 2020-08-21 18:38 Andrew Macleod
0 siblings, 0 replies; only message in thread
From: Andrew Macleod @ 2020-08-21 18:38 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:d88d33f898acb2d7e6f760de3f39966f0c22e3c5
commit d88d33f898acb2d7e6f760de3f39966f0c22e3c5
Author: Andrew MacLeod <amacleod@redhat.com>
Date: Fri Aug 21 14:35:57 2020 -0400
parity with evrp.
dont use globally set SSA_NAME_RANGE_INFOs breaks unreachable tests pr61034.C
/ 0 now returns varying , not undefined. pr61839_2.c
Diff:
---
gcc/gimple-range.h | 7 +++++++
gcc/range-op.cc | 4 ++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/gcc/gimple-range.h b/gcc/gimple-range.h
index 5e301bc0827..329f509b20c 100644
--- a/gcc/gimple-range.h
+++ b/gcc/gimple-range.h
@@ -125,6 +125,12 @@ gimple_range_global (tree name)
{
gcc_checking_assert (gimple_range_ssa_p (name));
tree type = TREE_TYPE (name);
+#if 0
+ // Reenable picking up global ranges when we are OK failing tests that look
+ // for builtin_unreachable in the code, like
+ // RUNTESTFLAGS=dg.exp=pr61034.C check-g++
+ // pre-optimizations (inlining) set a global range which causes the ranger
+ // to remove the condition which leads to builtin_unreachable
if (!POINTER_TYPE_P (type) && SSA_NAME_RANGE_INFO (name))
{
// Return a range from an SSA_NAME's available range.
@@ -132,6 +138,7 @@ gimple_range_global (tree name)
enum value_range_kind kind = get_range_info (name, &min, &max);
return value_range (type, min, max, kind);
}
+#endif
// Otherwise return range for the type.
return value_range (type);
}
diff --git a/gcc/range-op.cc b/gcc/range-op.cc
index 310723dd311..b49c2c71dff 100644
--- a/gcc/range-op.cc
+++ b/gcc/range-op.cc
@@ -1317,10 +1317,10 @@ operator_div::wi_fold (irange &r, tree type,
const wide_int &lh_lb, const wide_int &lh_ub,
const wide_int &rh_lb, const wide_int &rh_ub) const
{
- // If we know we will divide by zero, return undefined.
+ // If we know we will divide by zero, return varying.
if (rh_lb == 0 && rh_ub == 0)
{
- r.set_undefined ();
+ r.set_varying (type);
return;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-08-21 18:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-21 18:38 [gcc(refs/users/aldyh/heads/ranger-staging)] parity with evrp 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).