https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101849

--- Comment #5 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Peter Bergner from comment #4)
> Is there a benefit of one over the other?  ...other than the build2 code
> being simpler since we'd just pass in the type we want.

So the following seems to work which seems a little simpler than what I
submitted.  I'll test this along with a little beefier test case with multiple
offsets, with some not constant.

      tree ptr_t = build_pointer_type (vector_pair_type_node);
      tree mem = build2 (MEM_REF, vector_pair_type_node,
                         build2 (POINTER_PLUS_EXPR, ptr_t, ptr, offset),
                         build_int_cst (ptr_t, 0));

Reply via email to