public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "fxue at os dot amperecomputing.com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/108117] Wrong instruction scheduling on value coming from abnormal SSA
Date: Thu, 15 Dec 2022 11:38:37 +0000	[thread overview]
Message-ID: <bug-108117-4-P4BNy1T0xa@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108117-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from Feng Xue <fxue at os dot amperecomputing.com> ---
(In reply to Andrew Pinski from comment #7)
> (In reply to Feng Xue from comment #6)
> > (In reply to Andrew Pinski from comment #2)
> > > https://en.cppreference.com/w/c/program/setjmp
> > 
> > I think that most programmers are not aware of this, neither I for sure.
> > Usage of volatile here is not that intuitive as for purpose of
> > multi-execution synchronization
> 
> You should read up on
> https://en.cppreference.com/w/cpp/utility/program/signal too.

From viewpoint of programmer, setjmp/longjmp is somewhat similar to C++
exception handling, which happens in one logical execution context, while
signal implies two  unrelated contexts.

In another angle, because gcc already model control flow and SSA web for
setjmp/longjmp, explicit volatile specification is not really needed. But
signal mechanism is kind of asynchronous exception, for which it is impractical
for compiler to do that, so volatile is must.

  parent reply	other threads:[~2022-12-15 11:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15  5:36 [Bug rtl-optimization/108117] New: " fxue at os dot amperecomputing.com
2022-12-15  5:42 ` [Bug rtl-optimization/108117] " pinskia at gcc dot gnu.org
2022-12-15  5:44 ` pinskia at gcc dot gnu.org
2022-12-15  5:46 ` pinskia at gcc dot gnu.org
2022-12-15  7:15 ` amonakov at gcc dot gnu.org
2022-12-15  8:30 ` amonakov at gcc dot gnu.org
2022-12-15  8:54 ` fxue at os dot amperecomputing.com
2022-12-15  9:01 ` pinskia at gcc dot gnu.org
2022-12-15 11:38 ` fxue at os dot amperecomputing.com [this message]
2022-12-15 12:44 ` amonakov at gcc dot gnu.org
2022-12-15 18:04 ` pinskia at gcc dot gnu.org
2022-12-15 18:06 ` pinskia at gcc dot gnu.org
2022-12-15 18:17 ` amonakov at gcc dot gnu.org
2022-12-15 18:19 ` pinskia at gcc dot gnu.org
2022-12-15 18:26 ` amonakov at gcc dot gnu.org
2022-12-15 18:33 ` amonakov at gcc dot gnu.org
2022-12-23  7:37 ` amonakov at gcc dot gnu.org
2023-01-13 18:33 ` cvs-commit at gcc dot gnu.org

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-108117-4-P4BNy1T0xa@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).