public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/44102]  New: ICE with asm goto + __builtin_unreachable () in C++
@ 2010-05-12 19:03 jakub at gcc dot gnu dot org
  2010-05-17 17:19 ` [Bug middle-end/44102] " jakub at gcc dot gnu dot org
  2010-05-17 17:34 ` jakub at gcc dot gnu dot org
  0 siblings, 2 replies; 4+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-05-12 19:03 UTC (permalink / raw)
  To: gcc-bugs

// { dg-do compile }
// { dg-options "-O2" }

void baz (void);
struct A { A (); ~A (); };

static inline int
foo (void)
{
  asm goto ("" : : : : l1, l2);
  __builtin_unreachable ();
 l1:
  return 1;
 l2:
  return 0;
}

int
bar (int x)
{
  if (x == 5)
    {
      A a, b;
      baz ();
    }
  if (foo () || x == 6)
    x = 1;
  else
    x = 2;
  return x;
}

ICEs at -O2.  The problem is that RTL EH pass deletes the empty basic block
before getting into cfglayout mode, and while deleting empty bbs in cfglayout
mode apparently works, it doesn't work in normal rtl mode (when BB_HEAD ==
BB_END).  The following barrier is deleted too and nothing readds it after the
precious bb (the one ending with the asm goto).


-- 
           Summary: ICE with asm goto + __builtin_unreachable () in C++
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44102


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

end of thread, other threads:[~2024-03-25  4:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-44102-4@http.gcc.gnu.org/bugzilla/>
2012-11-30 14:20 ` [Bug middle-end/44102] ICE with asm goto + __builtin_unreachable () in C++ steven at gcc dot gnu.org
2024-03-25  4:59 ` pinskia at gcc dot gnu.org
2010-05-12 19:03 [Bug middle-end/44102] New: " jakub at gcc dot gnu dot org
2010-05-17 17:19 ` [Bug middle-end/44102] " jakub at gcc dot gnu dot org
2010-05-17 17:34 ` jakub at gcc dot gnu dot 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).