This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] PR 32283
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 17 Nov 2008 14:10:34 +0100
- Subject: Re: [patch] PR 32283
- References: <20081117034139.GA7953@kam.mff.cuni.cz>
> -- changes to loop-iv.c and simplify-rtx.c to enable us to determine
> that ((x << 2) - 4) & 3 == 0.
The change to simplify-rtx.c makes sense, but you should not need it
unless, of course, you know that the entire expression is never passed
to simplify-rtx.c:
- x << 2 has ~3 for its nonzero_bits
- 4 has 4 for its nonzero_bits
- (x << 2) - 4 has (see around rtlanal.c:3834)
width0 = 32
width1 = 2
low0 = 2
low1 = 2
op0_maybe_minusp = 1
op1_maybe_minusp = 0
result_width = 32
result_low = 4
nonzero = ~3
- and then
/* If we are turning off bits already known off in OP0, we need
not do an AND. */
if (GET_CODE (trueop1) == CONST_INT
&& GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT
&& (nonzero_bits (trueop0, mode) & ~INTVAL (trueop1)) == 0)
return op0;
Unless, again, you know that the entire expression is never passed to
simplify-rtx.c, can you check why this does not happen?
Thanks,
Paolo