From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Avoid shift in get_ref_base_and_extent
Date: Fri, 27 May 2022 14:08:10 +0200 (CEST) [thread overview]
Message-ID: <20220527120810.A45CA13A84@imap2.suse-dmz.suse.de> (raw)
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.
Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.
* tree-dfa.cc (get_ref_base_and_extent): Avoid shift.
---
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;
}
--
2.35.3
reply other threads:[~2022-05-27 12:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220527120810.A45CA13A84@imap2.suse-dmz.suse.de \
--to=rguenther@suse.de \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).