aboutsummaryrefslogtreecommitdiff
path: root/gcc/bitmap.h
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2017-01-31 10:30:47 +0000
committerAldy Hernandez <aldyh@gcc.gnu.org>2017-01-31 10:30:47 +0000
commit8b670f93ab11361ae88a22fea4f96c770afb6311 (patch)
tree36ec292abbd9b98c6a30917ff5375daaefcbd37e /gcc/bitmap.h
parent4727e06bb7c047a10aa502c829b7e4b519d8082b (diff)
downloadgcc-8b670f93ab11361ae88a22fea4f96c770afb6311.zip
gcc-8b670f93ab11361ae88a22fea4f96c770afb6311.tar.gz
gcc-8b670f93ab11361ae88a22fea4f96c770afb6311.tar.bz2
re PR tree-optimization/71691 (wrong code at -O3 in both 32-bit and 64-bit modes on x86_64-linux-gnu (Floating point exception))
PR tree-optimization/71691 * bitmap.h (class auto_bitmap): New. * tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Call is_maybe_undefined instead of ssa_undefined_value_p. From-SVN: r245057
Diffstat (limited to 'gcc/bitmap.h')
-rw-r--r--gcc/bitmap.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/bitmap.h b/gcc/bitmap.h
index 196738b..f158b44 100644
--- a/gcc/bitmap.h
+++ b/gcc/bitmap.h
@@ -802,4 +802,25 @@ bmp_iter_and_compl (bitmap_iterator *bi, unsigned *bit_no)
bmp_iter_and_compl (&(ITER), &(BITNUM)); \
bmp_iter_next (&(ITER), &(BITNUM)))
+/* A class that ties the lifetime of a bitmap to its scope. */
+class auto_bitmap
+{
+ public:
+ auto_bitmap () { bits = BITMAP_ALLOC (NULL); }
+ ~auto_bitmap () { BITMAP_FREE (bits); }
+ // Allow calling bitmap functions on our bitmap.
+ operator bitmap () { return bits; }
+
+ private:
+ // Prevent making a copy that references our bitmap.
+ auto_bitmap (const auto_bitmap &);
+ auto_bitmap &operator = (const auto_bitmap &);
+#if __cplusplus >= 201103L
+ auto_bitmap (auto_bitmap &&);
+ auto_bitmap &operator = (auto_bitmap &&);
+#endif
+
+ bitmap bits;
+};
+
#endif /* GCC_BITMAP_H */