Bug 1017704 - asm goto miscompilation
Summary: asm goto miscompilation
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gcc
Version: 7.0
Hardware: x86_64
OS: Linux
urgent
urgent
Target Milestone: beta
: 7.0
Assignee: Jakub Jelinek
QA Contact: Dagmar Prokopová
URL:
Whiteboard:
Depends On: 1018072
Blocks: 1017708
TreeView+ depends on / blocked
 
Reported: 2013-10-10 11:13 UTC by Marek Polacek
Modified: 2014-07-01 22:54 UTC (History)
5 users (show)

Fixed In Version: gcc-4.8.2-2.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1017708 (view as bug list)
Environment:
Last Closed: 2014-06-13 11:27:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 58670 0 None None None Never

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.


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