+ if (!pre_p && MEM_P (e->expr))
+ /* Note memory references that can be clobbered by a call.
+ We do not split abnormal edges in HOIST, so would
+ a memory reference get hoisted along an abnormal edge,
+ it would be placed /before/ the call. Therefore, only
+ constant memory references can be hoisted along abnormal
+ edges. */
+ {
+ if (GET_CODE (XEXP (e->expr, 0)) == SYMBOL_REF
+ && CONSTANT_POOL_ADDRESS_P (XEXP (e->expr, 0)))
+ continue;
This is the only part I'm struggling with. It looks like you're trying
to avoid setting prune_exprs if the MEM's address has certain properties
(such as a reference to static memory). However, if my analysis of the
problem is correct, that's not sufficient to solve the problem.
This code comes straight from compute_transpout.
Why do you think these checks aren't sufficient? A memory reference to a
constant pool is, well, a constant.
It may be that the second check
if (MEM_READONLY_P (e->expr)
&& !MEM_VOLATILE_P (e->expr)
&& MEM_NOTRAP_P (e->expr))
/* Constant memory reference, e.g., a PIC address. */
continue;
implies CONSTANT_POOL_ADDRESS_P, but I prefer to err on the side of
caution have both checks in place.