This is the mail archive of the
mailing list for the GCC project.
Re: Record missing equivalence
- From: Jeff Law <law at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 21 Mar 2013 06:57:04 -0600
- Subject: Re: Record missing equivalence
- References: <514A8FE6 dot 7060704 at redhat dot com> <CAFiYyc2GSN9Aw1Lpgb4MegLkiRS9vHGV-a=RHZVGpjGX48LAZw at mail dot gmail dot com>
On 03/21/2013 03:44 AM, Richard Biener wrote:
+ if (defstmt
+ && is_gimple_assign (defstmt)
+ && CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (defstmt)))
+ tree old_rhs = gimple_assign_rhs1 (defstmt);
+ tree newval = fold_convert (TREE_TYPE (old_rhs), rhs);
You want to delay that folding and creating of a new tree node until after ...
[ ... ]
Right. I guess it couldn't hurt to filter out anything not an
INTEGER_CST earlier. While it wouldn't change the ultimate result, it
does make it clearer to the reader that this doesn't happen for
+ && operand_equal_p (rhs, newval, 0))
If you'd restricted yourself to handling INTEGER_CSTs then using
int_fits_type_p (rhs, TREE_TYPE (lhs)) would have been enough to check.
And operand_equal_p will never return for non-equal typed non-INTEGER_CSTs