Bug 1017708 - asm goto miscompilation
Summary: asm goto miscompilation
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Developer Toolset
Classification: Red Hat
Component: gcc
Version: DTS 2.1 RHEL 6
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: alpha
: 2.4
Assignee: Jakub Jelinek
QA Contact: Dagmar Prokopová
URL:
Whiteboard:
Depends On: 1017704
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-10 11:20 UTC by Marek Polacek
Modified: 2014-07-01 22:54 UTC (History)
7 users (show)

Fixed In Version: devtoolset-2-gcc-4.8.2-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of: 1017704
Environment:
Last Closed: 2014-03-11 06:37:14 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 58670 0 None None None Never
Red Hat Product Errata RHBA-2014:0272 0 normal SHIPPED_LIVE devtoolset-2-gcc bug fix and enhancement update 2014-03-11 10:33:11 UTC

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


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