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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-07-19
     Ever confirmed|0                           |1

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #3)
> That is even doing:
> ```
> int g();
> int h()
> {
> l0:;
>     int x __attribute__((cleanup(test4cleanup)));
>     if (g()) goto l0;
> }
> ```
> Produces the same result which is why I said this is the same as PR 91951
> really.

But the above works fine?

  <bb 2> :
l0:
  _1 = g ();
  if (_1 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  // predicted unlikely by goto predictor.
  finally_tmp.0 = 0;
  goto <bb 5>; [INV]

  <bb 4> :
  finally_tmp.0 = 1;

  <bb 5> :
  test4cleanup (&x);
  if (finally_tmp.0 == 1)
    goto <bb 6>; [INV]
  else
    goto <bb 2>; [INV]

  <bb 6> :
<L4>:

  <bb 7> :
  x = {CLOBBER(eol)};
  return;

so it goes wrong somewhere during EH lowering, possibly because asm goto
isn't handled there.  Confirmed.

Reply via email to