[Bug target/53090] suboptimal ivopt
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Apr 2 11:17:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53090
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think the main observation is that
use 1
address
in statement _15 = *_14;
at position *_14
type int *
base perm_9(D) + (sizetype) ((long unsigned int) (k_4(D) + -1) * 4)
step 18446744073709551612
base object (void *) perm_9(D)
related candidates
((long unsigned int) (k_4(D) + -1) * 4) is a widening multiplication
and the x86 addressing mode widens(?). Note that with the current
specification of TARGET_MEM_REF:
/* Low-level memory addressing. Operands are BASE (address of static or
global variable or register), OFFSET (integer constant),
INDEX (register), STEP (integer constant), INDEX2 (register),
The corresponding address is BASE + STEP * INDEX + INDEX2 + OFFSET.
Only variations and values valid on the target are allowed.
The type of STEP, INDEX and INDEX2 is sizetype.
this isn't allowed. One would need to a) extend the spec to allow
step * index be a widening multiplication, b) extend the recog code
in tree-ssa-address.c properly to see what the target does here,
esp. whether it treats INDEX as signed or unsigned.
Then IVOPTs could choose (unsigned) k_4 as IV and use it directly in
the widening multiplication places.
A way to test this would be to emit the widening multiplies from
c-common.c:pointer_int_sum already. (but expect lots of fallout, there is
a lot of code handling MULT_EXPR but not a lot handling WIDEN_MULT_EXPR)
More information about the Gcc-bugs
mailing list