This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/44102] New: ICE with asm goto + __builtin_unreachable () in C++
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 May 2010 19:02:42 -0000
- Subject: [Bug middle-end/44102] New: ICE with asm goto + __builtin_unreachable () in C++
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
// { 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