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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot 
gnu.org

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Mine.

After my patch for PR 102216, we get:

  _1 = &this_6(D)->data1;
  _2 = this_6(D) + 16;
  _19 = _2 - _1;

I suspect if we add:
(simplify
 (pointer_diff (pointer_plus @0 @1) ADDR_EXPR@2)
 (with { poly_int64 diff; }
   (if (ptr_difference_const (@0, @2, &diff))
    (plus { build_int_cst_type (type, diff); } (convert @1)))))
(simplify
 (pointer_diff ADDR_EXPR@0 (pointer_plus @1 @2))
 (with { poly_int64 diff; }
   (if (ptr_difference_const (@0, @1, &diff))
    (minus { build_int_cst_type (type, diff); } (convert @2)))))

This will work.

Reply via email to