Bug 634757

Summary: -O1 wrong-code by cmove
Product: [Fedora] Fedora Reporter: Jan Kratochvil <jan.kratochvil>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 14CC: bruno, jakub, maurizio.antillon, mschmidt, redhat-bugzilla, satellitgo
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: gcc-4.5.1-4.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-09-27 03:56:41 UTC Type: ---
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:    
Bug Blocks: 635508    

Description Jan Kratochvil 2010-09-16 21:41:19 UTC
tracker for the upstream Bug:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45695

Description of problem:
FSF GDB HEAD by FSF GCC 4.5.HEAD errors on `print 0|0' with -O1 and higher.

Version-Release number of selected component (if applicable):
FAIL: gcc-4.5.1-3.fc14.x86_64

How reproducible:
Always.

Steps to Reproduce:
gcc -O1 x.c
./a.out; echo $?

__attribute__((noinline, noclone)) void
g (int x)
{ 
  asm volatile ("");
}
__attribute__((noinline, noclone)) int
f (int a, int b, int d)
{
  int r = -1;
  b += d;
  if (d == a)
    r = b - d;
  g (b);
  return r; 
}
int 
main (void)
{ 
  asm volatile ("mov $42, %%rbx" : : : "rbx");
  return f (0, 1, 4) == 42 ? 1 : 0;
}

Actual results:
1

Expected results:
0

Additional info:

Comment 1 Fedora Update System 2010-09-24 22:14:18 UTC
gcc-4.5.1-4.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/gcc-4.5.1-4.fc14

Comment 2 Fedora Update System 2010-09-25 05:10:32 UTC
gcc-4.5.1-4.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update gcc'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/gcc-4.5.1-4.fc14

Comment 3 Fedora Update System 2010-09-27 03:56:32 UTC
gcc-4.5.1-4.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.