* explow.c (expr_size): If DECL and size specified, use it.
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Fri, 15 Jun 2001 22:05:09 +0000 (22:05 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Fri, 15 Jun 2001 22:05:09 +0000 (18:05 -0400)
From-SVN: r43407

gcc/ChangeLog
gcc/explow.c

index 2ba760a..639c3fa 100644 (file)
@@ -1,3 +1,7 @@
+Fri Jun 15 18:05:22 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       * explow.c (expr_size): If DECL and size specified, use it.
+
 2001-06-15  Zack Weinberg  <zackw@stanford.edu>
 
        * doc/cpp.texi: Formatting corrections.
index 921e555..0281826 100644 (file)
@@ -301,7 +301,13 @@ rtx
 expr_size (exp)
      tree exp;
 {
-  tree size = size_in_bytes (TREE_TYPE (exp));
+  tree size;
+
+  if (TREE_CODE_CLASS (TREE_CODE (exp)) == 'd'
+      && DECL_SIZE_UNIT (exp) != 0)
+    size = DECL_SIZE_UNIT (exp);
+  else
+    size = size_in_bytes (TREE_TYPE (exp));
 
   if (TREE_CODE (size) != INTEGER_CST
       && contains_placeholder_p (size))