]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Tue, 14 Feb 2006 01:59:16 +0000 (01:59 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Tue, 14 Feb 2006 01:59:16 +0000 (01:59 +0000)
2006-02-01  Steve Ellcey  <sje@cup.hp.com>

PR middle-end/24901
* fold-const.c (fold_checksum_tree): Change type of buf.

From-SVN: r110953

gcc/ChangeLog
gcc/fold-const.c

index 444a65773d3f30b1033b46f8509016b862a33f1e..f8e0bba8e71eaf9d013bda70ec6be48330f77974 100644 (file)
@@ -1,3 +1,11 @@
+2006-02-13  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       Backport:
+       2006-02-01  Steve Ellcey  <sje@cup.hp.com>
+
+       PR middle-end/24901
+       * fold-const.c (fold_checksum_tree): Change type of buf.
+
 2006-02-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * doc/contrib.texi: Update my entry.
index d786292bff868e85cef8dc4b52490a77760135bf..cc2698da09a45a8152908d1a50ffe414aa4a4dc4 100644 (file)
@@ -8442,7 +8442,7 @@ fold_checksum_tree (tree expr, struct md5_ctx *ctx, htab_t ht)
 {
   void **slot;
   enum tree_code code;
-  char buf[sizeof (struct tree_decl)];
+  struct tree_decl buf;
   int i, len;
 
   if (sizeof (struct tree_exp) + 5 * sizeof (tree)
@@ -8459,23 +8459,23 @@ fold_checksum_tree (tree expr, struct md5_ctx *ctx, htab_t ht)
   if (code == SAVE_EXPR && SAVE_EXPR_NOPLACEHOLDER (expr))
     {
       /* Allow SAVE_EXPR_NOPLACEHOLDER flag to be modified.  */
-      memcpy (buf, expr, tree_size (expr));
-      expr = (tree) buf;
+      memcpy (&buf, expr, tree_size (expr));
+      expr = (tree) &buf;
       SAVE_EXPR_NOPLACEHOLDER (expr) = 0;
     }
   else if (TREE_CODE_CLASS (code) == 'd' && DECL_ASSEMBLER_NAME_SET_P (expr))
     {
       /* Allow DECL_ASSEMBLER_NAME to be modified.  */
-      memcpy (buf, expr, tree_size (expr));
-      expr = (tree) buf;
+      memcpy (&buf, expr, tree_size (expr));
+      expr = (tree) &buf;
       SET_DECL_ASSEMBLER_NAME (expr, NULL);
     }
   else if (TREE_CODE_CLASS (code) == 't'
           && (TYPE_POINTER_TO (expr) || TYPE_REFERENCE_TO (expr)))
     {
       /* Allow TYPE_POINTER_TO and TYPE_REFERENCE_TO to be modified.  */
-      memcpy (buf, expr, tree_size (expr));
-      expr = (tree) buf;
+      memcpy (&buf, expr, tree_size (expr));
+      expr = (tree) &buf;
       TYPE_POINTER_TO (expr) = NULL;
       TYPE_REFERENCE_TO (expr) = NULL;
     }