From 1abd28c166a11a00301a69be114996b6266cf096 Mon Sep 17 00:00:00 2001 From: aoliva Date: Mon, 26 Nov 2007 06:37:46 +0000 Subject: [PATCH] * tree.c (type_hash_add): Don't violate strict aliasing rules. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130429 138bc75d-0d04-0410-961f-82ee72b054a4 --- 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,5 +1,9 @@ 2007-11-26 Alexandre Oliva + * tree.c (type_hash_add): Don't violate strict aliasing rules. + +2007-11-26 Alexandre Oliva + PR c/27898 * c-typeck.c (tagged_types_tu_compatible_p): Enable exact matches between anonymous union fields. 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.11.0