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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-03-15
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Eh, and we diagnose late because of a bug in pass_waccess::use_after_inval_p.
We have

<bb 4> [local count: 118111600]:
# q_12 = PHI <q_9(8), p_4(D)(7)>
free (p_4(D));

late but early the PHI is in an earlier block.  With the above we run into

  if (bitmap_set_bit (m_bb_uids_set, inval_bb->index))
    /* The first time this basic block is visited assign increasing ids
       to consecutive statements in it.  Use the ids to determine which
       precedes which.  This avoids the linear traversal on subsequent
       visits to the same block.  */
    for (auto si = gsi_start_bb (inval_bb); !gsi_end_p (si);
         gsi_next_nondebug (&si)) 
      {
        gimple *stmt = gsi_stmt (si);
        unsigned uid = inc_gimple_stmt_max_uid (m_func);
        gimple_set_uid (stmt, uid);
      }

  return gimple_uid (inval_stmt) < gimple_uid (use_stmt);

but we never set UIDs for PHIs so the answer here is random.

Reply via email to