This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Improved SAVE_EXPR handling in operand_equal_p.


> The patch below fixes this by considering two SAVE_EXPRs that wrap
> operand_equal_p subexpressions (which ensures they have no side-effects)
> as equal.  This is also extended slightly by treating SAVE_EXPR much
> like a NOP, so that a SAVE_EXPR(x) is also considered equal to x.

This is not really true.  A SAVE_EXPR is a temporary variable.
It's value depends on when it is evaluated.  Thus

	$x = SAVE_EXPR (d)
	d++;
	$y = SAVE_EXPR (d)

	$x != $y

It is *possible* that if you have two unevaluated SAVE_EXPRs,
i.e. SAVE_EXPR_RTL is still null, that the values of their 
saves will evaluate to be the same.  I'm not certain that we
can truely assume this in something as general as operand_equal_p.

You've either got to fix this at the rtl level, or wait for the
tree-ssa branch and get it fixed there.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]