]> gcc.gnu.org Git - gcc.git/commitdiff
emit-rtl.c (set_mem_attributes): Fix size and alignment thinkos in ARRAY_REF of DECL_...
authorRichard Henderson <rth@redhat.com>
Thu, 25 Jul 2002 17:33:43 +0000 (10:33 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 25 Jul 2002 17:33:43 +0000 (10:33 -0700)
        * emit-rtl.c (set_mem_attributes): Fix size and alignment thinkos
        in ARRAY_REF of DECL_P case.

From-SVN: r55752

gcc/ChangeLog
gcc/emit-rtl.c

index ad40abd9b0bd5d27f73127088b4368a69d4ed0cb..ef6b358992ff1d8b5d8c2f6468bf40c1bcbbbd32 100644 (file)
@@ -1,3 +1,8 @@
+2002-07-25  Richard Henderson  <rth@redhat.com>
+
+       * emit-rtl.c (set_mem_attributes): Fix size and alignment thinkos
+       in ARRAY_REF of DECL_P case.
+
 2002-07-25  Richard Sandiford  <rsandifo@redhat.com>
 
        * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI
index ab73f00c6bbd36daebf0de220b4026da70b8a23b..67c4cfbcd039638dd47b4b50a807454d2b93d6c4 100644 (file)
@@ -1808,12 +1808,16 @@ set_mem_attributes (ref, t, objectp)
          if (DECL_P (t))
            {
              expr = t;
+             offset = NULL;
              if (host_integerp (off_tree, 1))
-               offset = GEN_INT (tree_low_cst (off_tree, 1));
-             size = (DECL_SIZE_UNIT (t)
-                     && host_integerp (DECL_SIZE_UNIT (t), 1)
-                     ? GEN_INT (tree_low_cst (DECL_SIZE_UNIT (t), 1)) : 0);
-             align = DECL_ALIGN (t);
+               {
+                 HOST_WIDE_INT ioff = tree_low_cst (off_tree, 1);
+                 HOST_WIDE_INT aoff = (ioff & -ioff) * BITS_PER_UNIT;
+                 align = DECL_ALIGN (t);
+                 if (aoff && aoff < align)
+                   align = aoff;
+                 offset = GEN_INT (ioff);
+               }
            }
          else if (TREE_CODE (t) == COMPONENT_REF)
            {
This page took 0.106387 seconds and 5 git commands to generate.