From: Jeff Law Date: Fri, 24 Sep 2004 22:31:13 +0000 (-0600) Subject: tree-ssa-dom.c (dom_opt_finalize_block): Fix violation of strict aliasing rules. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b8545fbfe5d64073614eb66c7e1c1cae74e7c082;p=gcc.git tree-ssa-dom.c (dom_opt_finalize_block): Fix violation of strict aliasing rules. * tree-ssa-dom.c (dom_opt_finalize_block): Fix violation of strict aliasing rules. (simplify_cond_and_lookup_avail_expr): Likewise. From-SVN: r88077 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ddfa56b1440..9ff33e2e534 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-09-24 Jeff Law + + * tree-ssa-dom.c (dom_opt_finalize_block): Fix violation of strict + aliasing rules. + (simplify_cond_and_lookup_avail_expr): Likewise. + 2004-09-24 Joseph S. Myers PR c/12802 diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c index 97ee1997515..8bce1c3a9aa 100644 --- a/gcc/tree-ssa-dom.c +++ b/gcc/tree-ssa-dom.c @@ -978,7 +978,7 @@ dom_opt_finalize_block (struct dom_walk_data *walk_data, basic_block bb) while (VARRAY_ACTIVE_SIZE (vrp_variables_stack) > 0) { tree var = VARRAY_TOP_TREE (vrp_variables_stack); - struct vrp_hash_elt vrp_hash_elt; + struct vrp_hash_elt vrp_hash_elt, *vrp_hash_elt_p; void **slot; /* Each variable has a stack of value range records. We want to @@ -998,7 +998,9 @@ dom_opt_finalize_block (struct dom_walk_data *walk_data, basic_block bb) slot = htab_find_slot (vrp_data, &vrp_hash_elt, NO_INSERT); - var_vrp_records = (*(struct vrp_hash_elt **)slot)->records; + vrp_hash_elt_p = (struct vrp_hash_elt *) *slot; + var_vrp_records = vrp_hash_elt_p->records; + while (VARRAY_ACTIVE_SIZE (var_vrp_records) > 0) { struct vrp_element *element @@ -1894,7 +1896,7 @@ simplify_cond_and_lookup_avail_expr (tree stmt, int lowequal, highequal, swapped, no_overlap, subset, cond_inverted; varray_type vrp_records; struct vrp_element *element; - struct vrp_hash_elt vrp_hash_elt; + struct vrp_hash_elt vrp_hash_elt, *vrp_hash_elt_p; void **slot; /* First see if we have test of an SSA_NAME against a constant @@ -1944,7 +1946,8 @@ simplify_cond_and_lookup_avail_expr (tree stmt, if (slot == NULL) return NULL; - vrp_records = (*(struct vrp_hash_elt **)slot)->records; + vrp_hash_elt_p = (struct vrp_hash_elt *) *slot; + vrp_records = vrp_hash_elt_p->records; if (vrp_records == NULL) return NULL;