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

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
And it is ehcleanup that sinks the clobber.  Before ehcleanup1 we have:
;;   basic block 16, loop depth 0, maybe hot
;;    prev block 15, next block 17, flags: (NEW, REACHABLE, VISITED)
;;    pred:       15 (EH,EXECUTABLE)
<L7>:
  D.31524 ={v} {CLOBBER(eol)};
  resx 10
;;    succ:       17 (EH,EXECUTABLE)

;;   basic block 17, loop depth 0, maybe hot
;;    prev block 16, next block 18, flags: (NEW, REACHABLE, VISITED)
;;    pred:       4 (EH,EXECUTABLE)
;;                16 (EH,EXECUTABLE)
  # _3 = PHI <1(4), 0(16)>
<L8>:
  D.31523 ={v} {CLOBBER(eol)};
  resx 9
;;    succ:       18 (EH,EXECUTABLE)

;;   basic block 18, loop depth 0, maybe hot
;;    prev block 17, next block 19, flags: (NEW, REACHABLE, VISITED)
;;    pred:       17 (EH,EXECUTABLE)
<L9>:
  if (_3 != 0)
    goto <bb 19>; [INV]
  else
    goto <bb 22>; [INV]
;;    succ:       19 (TRUE_VALUE,EXECUTABLE)
;;                22 (FALSE_VALUE,EXECUTABLE)

;;   basic block 19, loop depth 0, maybe hot
;;    prev block 18, next block 20, flags: (NEW, REACHABLE, VISITED)
;;    pred:       18 (TRUE_VALUE,EXECUTABLE)
  _55 = MEM[(const struct basic_string *)&D.31524]._M_dataplus._M_p;

so at this point, if we enter bb 17 from the edge from bb 4, D.31524 isn't
clobbered and the
_55 load is done (and conditional operator delete later), if we enter bb 16
then D.31524 is clobbered and then _3 is 0 and we don't try to delete it again.
But ehcleanup1, probably on the assumption that such conditional cleanups
aren't valid, turns that into:
...
;;   basic block 14, loop depth 0, maybe hot
;;    prev block 13, next block 15, flags: (NEW, REACHABLE, VISITED)
;;    pred:       4 (EH,EXECUTABLE)
;;                13 (EH,EXECUTABLE)
  # _3 = PHI <1(4), 0(13)>
<L8>:
  D.31524 ={v} {CLOBBER(eol)};
  D.31523 ={v} {CLOBBER(eol)};
  if (_3 != 0)
    goto <bb 15>; [INV]
  else
    goto <bb 18>; [INV]
;;    succ:       15 (TRUE_VALUE,EXECUTABLE)
;;                18 (FALSE_VALUE,EXECUTABLE)

;;   basic block 15, loop depth 0, maybe hot
;;    prev block 14, next block 16, flags: (NEW, REACHABLE, VISITED)
;;    pred:       14 (TRUE_VALUE,EXECUTABLE)
  _55 = MEM[(const struct basic_string *)&D.31524]._M_dataplus._M_p;
i.e. now D.31524 ={v} {CLOBBER(eol)}; is done no matter which path we enver
that bb from and then uninit pass is right about the warning, because
the _55 = MEM... load reads an uninitialized var.

Reply via email to