aboutsummaryrefslogtreecommitdiff
path: root/gcc/value-range.h
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2022-10-11 19:20:47 +0200
committerAldy Hernandez <aldyh@redhat.com>2022-10-12 08:48:59 +0200
commit6ce0823721d476cabb2007fecc12c07202325e17 (patch)
tree741adf98138662f0189da74818e4c9c6a0cfaf3a /gcc/value-range.h
parenta901343aa314eb08b362fc6878456d12f96e49b7 (diff)
downloadgcc-6ce0823721d476cabb2007fecc12c07202325e17.zip
gcc-6ce0823721d476cabb2007fecc12c07202325e17.tar.gz
gcc-6ce0823721d476cabb2007fecc12c07202325e17.tar.bz2
Disable tree to bool conversion in frange::update_nan.
We have a set_nan(type) method which can be confused with update_nan(bool) because of the silent conversion of pointers to bool. Currently, if you call update_nan(tree), you'll set the possibility of NAN with a sign of true if tree is non-null. This is prone to error and this patch disallows this behavior. gcc/ChangeLog: * value-range.cc (frange::set_nonnegative): Pass bool to update_nan. * value-range.h: Disallow conversion to bool in update_nan().
Diffstat (limited to 'gcc/value-range.h')
-rw-r--r--gcc/value-range.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/value-range.h b/gcc/value-range.h
index 9d630e4..cb5e9d0 100644
--- a/gcc/value-range.h
+++ b/gcc/value-range.h
@@ -317,6 +317,7 @@ public:
const REAL_VALUE_TYPE &upper_bound () const;
void update_nan ();
void update_nan (bool sign);
+ void update_nan (tree) = delete; // Disallow silent conversion to bool.
void clear_nan ();
// fpclassify like API