Bug 1017704

Summary: asm goto miscompilation
Product: Red Hat Enterprise Linux 7 Reporter: Marek Polacek <mpolacek>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact: Dagmar Prokopová <dprokopo>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.0CC: dprokopo, mcermak, mnewsome, mpolacek, ohudlick
Target Milestone: beta   
Target Release: 7.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: gcc-4.8.2-2.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1017708 (view as bug list) Environment:
Last Closed: 2014-06-13 11:27:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1018072    
Bug Blocks: 1017708    

Description Marek Polacek 2013-10-10 11:13:55 UTC
__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.

Jakub has a fix.

Comment 4 Marek Polacek 2013-10-21 10:48:24 UTC
Fixed.

Comment 7 Dagmar Prokopová 2013-11-17 00:27:47 UTC
Verified for gcc-4.8.2-3.el7.

Comment 8 Ludek Smid 2014-06-13 11:27:29 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.