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

Richard Biener <rguenth at gcc dot gnu.org> changed:

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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Thanks for tracking down.  Obviously

  /* If the MEM_REF has no acceptable address, try to get the base object
     from the original address we got, and build an all-aliasing
     unknown-sized access to that one.  */
  if (is_gimple_mem_ref_addr (TREE_OPERAND (exp, 0)))
    set_mem_attributes (mem, exp, 0);
  else if (TREE_CODE (TREE_OPERAND (exp, 0)) == ADDR_EXPR
           && (exp = get_base_address (TREE_OPERAND (TREE_OPERAND (exp, 0),
                                                     0))))
    {
      exp = build_fold_addr_expr (exp);
      exp = fold_build2 (MEM_REF,
                         build_array_type (char_type_node,
                                           build_range_type (sizetype,
                                                             size_zero_node,
                                                             NULL)),
                         exp, build_int_cst (ptr_type_node, 0));
      set_mem_attributes (mem, exp, 0);

^^^

is broken.  Looks like introduced with r0-117468-g625ed1721782f6

Reply via email to