Bug 1017704 - asm goto miscompilation
asm goto miscompilation
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gcc (Show other bugs)
7.0
x86_64 Linux
urgent Severity urgent
: beta
: 7.0
Assigned To: Jakub Jelinek
Dagmar Prokopová
:
Depends On: 1018072
Blocks: 1017708
  Show dependency treegraph
 
Reported: 2013-10-10 07:13 EDT by Marek Polacek
Modified: 2014-07-01 18:54 EDT (History)
5 users (show)

See Also:
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 07:27:29 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 58670 None None None Never

  None (edit)
Description Marek Polacek 2013-10-10 07:13:55 EDT
__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 06:48:24 EDT
Fixed.
Comment 7 Dagmar Prokopová 2013-11-16 19:27:47 EST
Verified for gcc-4.8.2-3.el7.
Comment 8 Ludek Smid 2014-06-13 07:27:29 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.