+Wed Mar 18 13:46:07 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * fold-const.c (operand_equal_for_comparison_p): See if equal
+ when nop conversions are removed.
+
Wed Mar 18 13:42:01 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* expr.c (expand_expr, case COND_EXPR): If have conditional move,
tree other;
{
int unsignedp1, unsignedpo;
- tree primarg1, primother;
+ tree primarg0, primarg1, primother;
unsigned correct_width;
if (operand_equal_p (arg0, arg1, 0))
|| ! INTEGRAL_TYPE_P (TREE_TYPE (arg1)))
return 0;
+ /* Discard any conversions that don't change the modes of ARG0 and ARG1
+ and see if the inner values are the same. This removes any
+ signedness comparison, which doesn't matter here. */
+ primarg0 = arg0, primarg1 = arg1;
+ STRIP_NOPS (primarg0); STRIP_NOPS (primarg1);
+ if (operand_equal_p (primarg0, primarg1, 0))
+ return 1;
+
/* Duplicate what shorten_compare does to ARG1 and see if that gives the
actual comparison operand, ARG0.