From d4f1c1faff4405a94368214cb84694f9bb250c0c Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Wed, 25 Oct 2000 16:02:14 -0700 Subject: [PATCH] simplify-rtx.c (simplify_relational_operation): Sign extend low words before sign extending to high words. * simplify-rtx.c (simplify_relational_operation): Sign extend low words before sign extending to high words. From-SVN: r37061 --- gcc/ChangeLog | 5 +++++ gcc/simplify-rtx.c | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1ddc191751c..67eebfe60c5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-10-25 Richard Henderson + + * simplify-rtx.c (simplify_relational_operation): Sign extend + low words before sign extending to high words. + 2000-10-25 Nick Clifton * config/mcore/mcore.c: Include config.h before system.h. diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 85ce605abbf..648dcb4aea5 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -1812,9 +1812,6 @@ simplify_relational_operation (code, mode, op0, op1) /* If WIDTH is nonzero and smaller than HOST_BITS_PER_WIDE_INT, we have to sign or zero-extend the values. */ - if (width != 0 && width <= HOST_BITS_PER_WIDE_INT) - h0u = h1u = 0, h0s = HWI_SIGN_EXTEND (l0s), h1s = HWI_SIGN_EXTEND (l1s); - if (width != 0 && width < HOST_BITS_PER_WIDE_INT) { l0u &= ((HOST_WIDE_INT) 1 << width) - 1; @@ -1826,6 +1823,8 @@ simplify_relational_operation (code, mode, op0, op1) if (l1s & ((HOST_WIDE_INT) 1 << (width - 1))) l1s |= ((HOST_WIDE_INT) (-1) << width); } + if (width != 0 && width <= HOST_BITS_PER_WIDE_INT) + h0u = h1u = 0, h0s = HWI_SIGN_EXTEND (l0s), h1s = HWI_SIGN_EXTEND (l1s); equal = (h0u == h1u && l0u == l1u); op0lt = (h0s < h1s || (h0s == h1s && l0u < l1u)); -- 2.30.2