Bug 1017708

Summary: asm goto miscompilation
Product: Red Hat Developer Toolset Reporter: Marek Polacek <mpolacek>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact: Dagmar Prokopová <dprokopo>
Severity: high Docs Contact:
Priority: unspecified    
Version: DTS 2.1 RHEL 6CC: dprokopo, law, mcermak, mfranc, mnewsome, mpolacek, ohudlick
Target Milestone: alpha   
Target Release: 2.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: devtoolset-2-gcc-4.8.2-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1017704 Environment:
Last Closed: 2014-03-11 06:37:14 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:
Embargoed:
Bug Depends On: 1017704    
Bug Blocks:    

Description Marek Polacek 2013-10-10 11:20:41 UTC
+++ This bug was initially created as a clone of Bug #1017704 +++

__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 2 Marek Polacek 2013-10-17 12:02:15 UTC
Fixed in devtoolset-2-gcc-4.8.2-1.el6.

Comment 4 Dagmar Prokopová 2013-11-11 14:10:05 UTC
Verified for devtoolset-2-gcc-4.8.2-1.

Comment 6 errata-xmlrpc 2014-03-11 06:37:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-0272.html