From 907050e34f4d1b5471e738cf5a718a8c6f50e334 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 7 Nov 2018 10:33:22 +0100 Subject: Fix UBSAN in postreload-gcse.c (PR rtl-optimization/87868). 2018-11-07 Martin Liska PR rtl-optimization/87868 * postreload-gcse.c (eliminate_partially_redundant_load): Set threshold to max_count if we would overflow. * profile-count.h: Make max_count a public constant. From-SVN: r265869 --- gcc/profile-count.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/profile-count.h') diff --git a/gcc/profile-count.h b/gcc/profile-count.h index f4d0c34..5d3bcc7 100644 --- a/gcc/profile-count.h +++ b/gcc/profile-count.h @@ -641,8 +641,8 @@ public: type to hold various extra stages. */ static const int n_bits = 61; -private: static const uint64_t max_count = ((uint64_t) 1 << n_bits) - 2; +private: static const uint64_t uninitialized_count = ((uint64_t) 1 << n_bits) - 1; uint64_t m_val : n_bits; -- cgit v1.1