public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-799] Avoid shift in get_ref_base_and_extent
@ 2022-05-27 12:08 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2022-05-27 12:08 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:37c988bc1b22d1259a4d8e819fc33c65faa9debb
commit r13-799-g37c988bc1b22d1259a4d8e819fc33c65faa9debb
Author: Richard Biener <rguenther@suse.de>
Date: Fri May 27 14:07:03 2022 +0200
Avoid shift in get_ref_base_and_extent
This avoids one instance of a shift from bytes to bits in
get_ref_base_and_extent by using TYPE_SIZE instead of TYPE_SIZE_UNIT.
* tree-dfa.cc (get_ref_base_and_extent): Avoid shift.
Diff:
---
gcc/tree-dfa.cc | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/gcc/tree-dfa.cc b/gcc/tree-dfa.cc
index 21c82cedb9f..e75e3d605b3 100644
--- a/gcc/tree-dfa.cc
+++ b/gcc/tree-dfa.cc
@@ -453,8 +453,8 @@ get_ref_base_and_extent (tree exp, poly_int64_pod *poffset,
if (!next
|| TREE_CODE (stype) != RECORD_TYPE)
{
- tree fsize = DECL_SIZE_UNIT (field);
- tree ssize = TYPE_SIZE_UNIT (stype);
+ tree fsize = DECL_SIZE (field);
+ tree ssize = TYPE_SIZE (stype);
if (fsize == NULL
|| !poly_int_tree_p (fsize)
|| ssize == NULL
@@ -465,7 +465,6 @@ get_ref_base_and_extent (tree exp, poly_int64_pod *poffset,
poly_offset_int tem
= (wi::to_poly_offset (ssize)
- wi::to_poly_offset (fsize));
- tem <<= LOG2_BITS_PER_UNIT;
tem -= woffset;
maxsize += tem;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-27 12:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-27 12:08 [gcc r13-799] Avoid shift in get_ref_base_and_extent Richard Biener
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).