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; 3+ 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] 3+ messages in thread

* [Bug middle-end/44102] ICE with asm goto + __builtin_unreachable () in C++
  2010-05-12 19:03 [Bug middle-end/44102] New: ICE with asm goto + __builtin_unreachable () in C++ jakub at gcc dot gnu dot org
@ 2010-05-17 17:19 ` jakub at gcc dot gnu dot org
  2010-05-17 17:34 ` jakub at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-05-17 17:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jakub at gcc dot gnu dot org  2010-05-17 17:18 -------
Subject: Bug 44102

Author: jakub
Date: Mon May 17 17:18:24 2010
New Revision: 159495

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159495
Log:
        PR middle-end/44102
        * cfgcleanup.c (try_optimize_cfg): When removing trivially empty
        bb with no successors, move footer whenever in IR_RTL_CFGLAYOUT
        mode, not just when CLEANUP_CFGLAYOUT, and when in IR_RTL_CFGRTL
        add BARRIER after previous bb if needed.

        * g++.dg/ext/asmgoto1.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/ext/asmgoto1.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cfgcleanup.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug middle-end/44102] ICE with asm goto + __builtin_unreachable () in C++
  2010-05-12 19:03 [Bug middle-end/44102] New: ICE with asm goto + __builtin_unreachable () in C++ 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
  1 sibling, 0 replies; 3+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-05-17 17:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2010-05-17 17:34 -------
On branches/gcc-4_5-branch fixed by
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159499


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2010-05-17 17:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-12 19:03 [Bug middle-end/44102] New: ICE with asm goto + __builtin_unreachable () in C++ 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).