Avoid shift in get_ref_base_and_extent
authorRichard Biener <rguenther@suse.de>
Fri, 27 May 2022 12:07:03 +0000 (14:07 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 27 May 2022 12:08:18 +0000 (14:08 +0200)
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.

gcc/tree-dfa.cc

index 21c82ce..e75e3d6 100644 (file)
@@ -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;
                          }