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

Jeffrey A. Law <law at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|DUPLICATE                   |---

--- Comment #22 from Jeffrey A. Law <law at redhat dot com> ---
I don't think this is a duplicate of 21161.

AFAICT the core of the problem here is the multiple static assignments to the
pseudos holding cancel_arg and cancel_routine.

They set the objects to the same value, but the multiple-assignment nature is a
key aspect of the longjmp clobbering analysis.

I think the multiple assignment largely steps from the PHIs in this block:

;;   basic block 5, loop depth 0, count 536656163 (estimated locally), maybe
hot
;;    prev block 4, next block 6, flags: (NEW, REACHABLE, IRREDUCIBLE_LOOP,
VISITED)
;;    pred:       4 [always (guessed)]  count:268328082 (estimated locally)
(FALLTHRU,IRREDUCIBLE_LOOP,EXECUTABLE)
;;                6 [always (guessed)]  count:1716613 (estimated locally)
(ABNORMAL,DFS_BACK,IRREDUCIBLE_LOOP,EXECUTABLE)
;;                3 [50.0% (guessed)]  count:268328082 (estimated locally)
(IRREDUCIBLE_LOOP,FALSE_VALUE,EXECUTABLE)
  # __cancel_routine_9(ab) = PHI <cleanup_fn(4), __cancel_routine_10(ab)(6),
cleanup_fn(3)>
  # __cancel_arg_12(ab) = PHI <_1(4), __cancel_arg_13(ab)(6), _1(3)>
  _24 = __sigsetjmp (&__cancel_buf.__cancel_jmp_buf, 0);
  goto <bb 7>; [99.96%]


This happens in CCP1 and FRE1 for cancel_routine and cancel_arg respectively.
(replacinging a cancel_{arg,routine} with an equivalent).   Once replaced, it's
exceedingly hard to undo.  One could easily argue that we shouldn't to the
replacement in an abnormal PHI.

Regardless, this is separate from 21161.  There is a slim chance that fixing
21161 is a requirement to fix this BZ, but they are not duplicates AFAICT.

Reply via email to