From 942086bf73ee2ba6cfd7fdacc552940048437a6e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Markus=20B=C3=B6ck?= Date: Tue, 27 Oct 2020 09:53:08 -0400 Subject: [PATCH] analyzer: Change cast from long to intptr_t [PR96608] Casting to intptr_t states the intent of an integer to pointer cast more clearly and ensures that the cast causes no loss of precision on any platforms. LLP64 platforms eg. have a long value of 4 bytes and pointer values of 8 bytes which may even cause compiler errors. gcc/analyzer/ChangeLog: PR analyzer/96608 * store.h (hash): Cast to intptr_t instead of long --- gcc/analyzer/store.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/analyzer/store.h b/gcc/analyzer/store.h index 466c1830c0f..8054b34d9da 100644 --- a/gcc/analyzer/store.h +++ b/gcc/analyzer/store.h @@ -271,7 +271,7 @@ public: hashval_t hash () const { - return (binding_key::impl_hash () ^ (long)m_region); + return (binding_key::impl_hash () ^ (intptr_t)m_region); } bool operator== (const symbolic_binding &other) const { -- 2.30.2