This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Improved SAVE_EXPR handling in operand_equal_p.
- From: Richard Henderson <rth at redhat dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org, "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Wed, 3 Sep 2003 11:44:02 -0700
- Subject: Re: [PATCH] Improved SAVE_EXPR handling in operand_equal_p.
- References: <Pine.LNX.4.44.0309020646540.15455-100000@www.eyesopen.com>
> 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~