Hello,

While reading the function pre_edge_insert () in gcse.c, something
didn't make sense to me:

According to the documentation:
/* Where PRE_INSERT_MAP is nonzero, we add the expression on that edge
   if it reaches any of the deleted expressions.  */
I understand that before inserting an expression on an edge we should
check if it reaches a deleted anticipatable occurrence.
This also make sense, since we don't want to insert expression on edge
if none of the anticipatable occurrences it reaches was deleted for
some reason (e.g. all of these occurrences are inside a PARALLEL
instructions).

But, when we find a deleted anticipatable occurrence we do:

/* Insert this expression on this edge if it would
   reach the deleted occurrence in BB.  */
if (!TEST_BIT (inserted[e], j))

This test prevents us from inserting the same expression twice on the
same edge, but it doesn't check that this deleted occurrence is 
actually reached from the current edge.

If what I'm saying here is correct, some redundant expression might
be inserted.

It also seem to me that the "inserted" sbitmap is unnecessary. 
We could just use "continue" after an insertion instead of using
TEST_BIT (inserted[e], j) and SET_BIT (inserted[e], j).


Thanks,
Leehod.

Reply via email to