From 0043f60679c6c6b8b76acb75cf8a7e363aca1d06 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Mon, 26 Nov 2007 06:37:46 +0000 Subject: [PATCH] * tree.c (type_hash_add): Don't violate strict aliasing rules. From-SVN: r130429 --- gcc/ChangeLog | 4 ++++ gcc/tree.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e500186c6c5..83a3ee87289 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2007-11-26 Alexandre Oliva + + * tree.c (type_hash_add): Don't violate strict aliasing rules. + 2007-11-26 Alexandre Oliva PR c/27898 diff --git a/gcc/tree.c b/gcc/tree.c index 9c6547480b7..6cb76f05507 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -4677,7 +4677,7 @@ type_hash_add (hashval_t hashcode, tree type) h->hash = hashcode; h->type = type; loc = htab_find_slot_with_hash (type_hash_table, h, hashcode, INSERT); - *(struct type_hash **) loc = h; + *loc = (void*)h; } /* Given TYPE, and HASHCODE its hash code, return the canonical -- 2.30.2