This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/33828] Issues with the implementation of code hoisting in gcse.c
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Oct 2007 11:13:22 -0000
- Subject: [Bug rtl-optimization/33828] Issues with the implementation of code hoisting in gcse.c
- References: <bug-33828-280@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from steven at gcc dot gnu dot org 2007-10-20 11:13 -------
Again from gcse.c:compute_transpout():
static void
compute_transpout (void)
{
basic_block bb;
unsigned int i;
struct expr *expr;
sbitmap_vector_ones (transpout, last_basic_block);
FOR_EACH_BB (bb)
{
/* Note that flow inserted a nop a the end of basic blocks that
end in call instructions for reasons other than abnormal
control flow. */
if (! CALL_P (BB_END (bb)))
continue;
for (i = 0; i < expr_hash_table.size; i++)
for (expr = expr_hash_table.table[i]; expr ; expr =
expr->next_same_hash)
if (MEM_P (expr->expr))
{
if (GET_CODE (XEXP (expr->expr, 0)) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (XEXP (expr->expr, 0)))
continue;
/* ??? Optimally, we would use interprocedural alias
analysis to determine if this mem is actually killed
by this call. */
RESET_BIT (transpout[bb->index], expr->bitmap_index);
}
}
}
Notice the comment about interprocedural alias analysis. That's all nice and
dandy, but it would be a start to handle const and pure calls here first.
Calls to const and pure functions don't kill MEMs.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33828