public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/101373] New: PRE hoists trapping instructions over possibly throwing calls
@ 2021-07-08  7:36 rguenth at gcc dot gnu.org
  2021-07-08  7:37 ` [Bug tree-optimization/101373] " rguenth at gcc dot gnu.org
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-08  7:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101373
           Summary: PRE hoists trapping instructions over possibly
                    throwing calls
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

int __attribute__((const,noipa)) foo (int j)
{
  if (j != 0)
    throw 1;
  return 0;
}

int __attribute__((noipa)) bar (int *p, int n)
{
  int ret = 0;
  if (n)
    {
       foo (n);
       ret = *p;
    }
  ret += *p;
  return ret;
}

int main()
{
  try
    {
      return bar (nullptr, 1);
    }
  catch (...)
    {
      return 0;
    }
}


Here PRE hoists *p before the if (n) which it may not do.

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2022-01-05 14:41 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-08  7:36 [Bug tree-optimization/101373] New: PRE hoists trapping instructions over possibly throwing calls rguenth at gcc dot gnu.org
2021-07-08  7:37 ` [Bug tree-optimization/101373] " rguenth at gcc dot gnu.org
2021-07-08 14:12 ` rguenth at gcc dot gnu.org
2021-07-09  9:28 ` ebotcazou at gcc dot gnu.org
2021-07-09 10:12 ` rguenther at suse dot de
2021-07-09 11:05 ` ebotcazou at gcc dot gnu.org
2021-07-09 11:15 ` rguenth at gcc dot gnu.org
2021-07-09 16:33 ` ebotcazou at gcc dot gnu.org
2021-07-09 17:37 ` ebotcazou at gcc dot gnu.org
2021-07-09 19:43 ` ebotcazou at gcc dot gnu.org
2021-07-10 17:13 ` rguenther at suse dot de
2021-07-10 17:14 ` rguenther at suse dot de
2021-07-12  7:28 ` ebotcazou at gcc dot gnu.org
2021-07-12  8:30 ` rguenth at gcc dot gnu.org
2021-07-12  8:38 ` ebotcazou at gcc dot gnu.org
2021-07-12 14:47 ` cvs-commit at gcc dot gnu.org
2021-07-12 14:48 ` rguenth at gcc dot gnu.org
2021-08-17  9:21 ` cvs-commit at gcc dot gnu.org
2021-08-25  2:43 ` pinskia at gcc dot gnu.org
2021-10-13 11:09 ` cvs-commit at gcc dot gnu.org
2021-11-08 14:07 ` cvs-commit at gcc dot gnu.org
2022-01-05 14:41 ` rguenth at gcc dot gnu.org

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).