On Wed, 2 Nov 2011, Jakub Jelinek wrote: > Hi! > > - Gather vectorization patch + incremental patches > http://gcc.gnu.org/ml/gcc-patches/2011-10/msg02411.html
I'm not sure I like using new builtins for gather representation on the tree level too much, given that we are now moving towards using tree codes for suffle. Thus, how complicated would it be to have a gather tree code and optab and to handle the mixed size index issue in the expander? I realize this would be quite some reorg to the patchset ... so, why did you choose builtins over a more generic approach? > http://gcc.gnu.org/ml/gcc-patches/2011-10/msg02846.html + if (TREE_CODE (base) == MEM_REF) { - off = TREE_OPERAND (base, 1); + if (!integer_zerop (TREE_OPERAND (base, 1))) + { + if (off == NULL_TREE) + { + double_int moff = mem_ref_offset (base); + off = double_int_to_tree (sizetype, moff); + } + else + off = size_binop (PLUS_EXPR, off, TREE_OPERAND (base, 1)); that's not safe, TREE_OPEAND (base, 1) is of pointer type, so you unconditionally need to do the conversion to sizetype of TREE_OPEAND (base, 1). The routine lacks comments - it's got quite big and fails to state any reason for its complexity. I'm also not sure why DR would include any loop invariant parts of the SCEV - doesn't it instantiate just for the loop in question? Thanks, Richard.