public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/110728] should __attribute__((cleanup())) callback get invoked for indirect edges of asm goto
Date: Wed, 19 Jul 2023 07:01:59 +0000	[thread overview]
Message-ID: <bug-110728-4-rszgAOY4G0@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110728-4@http.gcc.gnu.org/bugzilla/>

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.

  parent reply	other threads:[~2023-07-19  7:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-18 21:23 [Bug c/110728] New: " ndesaulniers at google dot com
2023-07-18 21:29 ` [Bug c/110728] " pinskia at gcc dot gnu.org
2023-07-18 21:32 ` pinskia at gcc dot gnu.org
2023-07-18 21:33 ` pinskia at gcc dot gnu.org
2023-07-18 21:48 ` pinskia at gcc dot gnu.org
2023-07-18 23:22 ` rjmccall at gmail dot com
2023-07-19  7:01 ` rguenth at gcc dot gnu.org [this message]
2023-07-19 16:46 ` [Bug middle-end/110728] " ndesaulniers at google dot com
2023-07-19 17:16 ` rjmccall at gmail dot com
2023-08-03 14:38 ` matz at gcc dot gnu.org
2023-08-03 16:00 ` ndesaulniers at google dot com
2023-08-03 16:11 ` matz at gcc dot gnu.org
2023-08-03 17:07 ` rjmccall at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-110728-4-rszgAOY4G0@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).