This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/58670] New: asm goto miscompilation
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 09 Oct 2013 18:12:33 +0000
- Subject: [Bug middle-end/58670] New: asm goto miscompilation
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
Bug ID: 58670
Summary: asm goto miscompilation
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: jakub at gcc dot gnu.org
__attribute__((noinline, noclone)) int
foo (int a, int b)
{
if (a)
return -3;
asm volatile goto ("bts $1, %0; jc %l[lab]" : : "m" (b) : "memory" : lab);
return 0;
lab:
return 0;
}
int
main ()
{
if (foo (1, 0) != -3 || foo (0, 3) != 0 || foo (0, 0) != 0)
__builtin_abort ();
return 0;
}
is miscompiled, *.optimized dump looks fine, but expansion looks wrong, perhaps
during expansion we don't handle the case of at least one asm goto labels
pointing to the fallthru block.