> As a workaround, I had may_be_unaligned_p() return true if toffset is
> set, but there's likely times when that results in suboptimal code.
Wouldn't this be sufficient?
Index: tree-ssa-loop-ivopts.c
===================================================================
--- tree-ssa-loop-ivopts.c (revision 158148)
+++ tree-ssa-loop-ivopts.c (working copy)
@@ -1546,6 +1546,9 @@ may_be_unaligned_p (tree ref, tree step)
|| bitpos % BITS_PER_UNIT != 0)
return true;
+ if (toffset && !constant_multiple_of (toffset, al, &mul))
+ return true;
+
if (!constant_multiple_of (step, al, &mul))
return true;
}
--
Eric Botcazou