aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSteve Ellcey <sje@cup.hp.com>2006-02-02 00:13:39 +0000
committerSteve Ellcey <sje@gcc.gnu.org>2006-02-02 00:13:39 +0000
commit3f7f53c7b3c1495c38856bdb05890174706827f0 (patch)
treea0b19fe3d46d2575cdc15be4eee119ab20f05f34 /gcc
parent65b4c3370fbfb06b33e313763afdf28715402bfa (diff)
downloadgcc-3f7f53c7b3c1495c38856bdb05890174706827f0.zip
gcc-3f7f53c7b3c1495c38856bdb05890174706827f0.tar.gz
gcc-3f7f53c7b3c1495c38856bdb05890174706827f0.tar.bz2
re PR middle-end/24901 (Misaligned data in fold_checksum_tree (--enable-checking=all))
PR middle-end/24901 * fold-const.c (fold_checksum_tree): Change type of buf. From-SVN: r110487
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/fold-const.c10
2 files changed, 10 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 027a773..a4d94fe 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+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-01 Bernd Schmidt <bernd.schmidt@analog.com>
* reload.c (push_secondary_reload): Initialize t_icode.
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index ed100ce..242a0ff 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -10476,7 +10476,7 @@ fold_checksum_tree (tree expr, struct md5_ctx *ctx, htab_t ht)
{
void **slot;
enum tree_code code;
- char buf[sizeof (struct tree_function_decl)];
+ struct tree_function_decl buf;
int i, len;
recursive_label:
@@ -10495,8 +10495,8 @@ recursive_label:
&& DECL_ASSEMBLER_NAME_SET_P (expr))
{
/* Allow DECL_ASSEMBLER_NAME to be modified. */
- memcpy (buf, expr, tree_size (expr));
- expr = (tree) buf;
+ memcpy ((char *) &buf, expr, tree_size (expr));
+ expr = (tree) &buf;
SET_DECL_ASSEMBLER_NAME (expr, NULL);
}
else if (TREE_CODE_CLASS (code) == tcc_type
@@ -10505,8 +10505,8 @@ recursive_label:
|| TYPE_CONTAINS_PLACEHOLDER_INTERNAL (expr)))
{
/* Allow these fields to be modified. */
- memcpy (buf, expr, tree_size (expr));
- expr = (tree) buf;
+ memcpy ((char *) &buf, expr, tree_size (expr));
+ expr = (tree) &buf;
TYPE_CONTAINS_PLACEHOLDER_INTERNAL (expr) = 0;
TYPE_POINTER_TO (expr) = NULL;
TYPE_REFERENCE_TO (expr) = NULL;