------- Comment #26 from rguenth at gcc dot gnu dot org 2007-04-25 14:22 ------- We fail to add the SFTs to the may_alias set of SMT.11, so add_virtual_operand sees NULL may_aliases and doesn't add SFTs as clobbered.
I believe compute_flow_insensitive_aliasing is the culprit here as one can easily see that if we enter the for (i = 0; i < ai->num_pointers; i++) { size_t j; struct alias_map_d *p_map1 = ai->pointers[i]; tree tag1 = var_ann (p_map1->var)->symbol_mem_tag; bitmap may_aliases1 = p_map1->may_aliases; if (PTR_IS_REF_ALL (p_map1->var)) continue; for (j = i + 1; j < ai->num_pointers; j++) { struct alias_map_d *p_map2 = ai->pointers[j]; tree tag2 = var_ann (p_map2->var)->symbol_mem_tag; bitmap may_aliases2 = p_map2->may_aliases; loop with may_aliases2 empty it will stay so. So as a fix I suggest to add may aliases symmetrically like with Index: tree-ssa-alias.c =================================================================== *** tree-ssa-alias.c (revision 124151) --- tree-ssa-alias.c (working copy) *************** compute_flow_insensitive_aliasing (struc *** 1287,1292 **** --- 1287,1294 ---- struct alias_map_d *p_map2 = ai->pointers[j]; tree tag2 = var_ann (p_map2->var)->symbol_mem_tag; bitmap may_aliases2 = p_map2->may_aliases; + unsigned int k; + bitmap_iterator bi; if (PTR_IS_REF_ALL (p_map2->var)) continue; *************** compute_flow_insensitive_aliasing (struc *** 1301,1323 **** continue; if (!bitmap_empty_p (may_aliases2)) ! { ! unsigned int k; ! bitmap_iterator bi; ! ! /* Add all the aliases for TAG2 into TAG1's alias set. ! FIXME, update grouping heuristic counters. */ ! EXECUTE_IF_SET_IN_BITMAP (may_aliases2, 0, k, bi) ! add_may_alias (tag1, referenced_var (k)); ! bitmap_ior_into (may_aliases1, may_aliases2); ! } else ! { ! /* Since TAG2 does not have any aliases of its own, add ! TAG2 itself to the alias set of TAG1. */ ! add_may_alias (tag1, tag2); ! bitmap_set_bit (may_aliases1, DECL_UID (tag2)); ! } } } --- 1303,1325 ---- continue; if (!bitmap_empty_p (may_aliases2)) ! /* Add all the aliases for TAG2 into TAG1's alias set. ! FIXME, update grouping heuristic counters. */ ! EXECUTE_IF_SET_IN_BITMAP (may_aliases2, 0, k, bi) ! add_may_alias (tag1, referenced_var (k)); ! else ! add_may_alias (tag1, tag2); ! ! if (!bitmap_empty_p (may_aliases1)) ! /* Add all the aliases for TAG2 into TAG1's alias set. ! FIXME, update grouping heuristic counters. */ ! EXECUTE_IF_SET_IN_BITMAP (may_aliases1, 0, k, bi) ! add_may_alias (tag2, referenced_var (k)); else ! add_may_alias (tag2, tag1); ! ! bitmap_ior_into (may_aliases2, may_aliases1); ! bitmap_ior_into (may_aliases1, may_aliases2); } } but I have no clue what I am doing here. 't looks like big mess. I prepare the workaround as alternative ;) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30567