Bug 465807

Summary: [Regression] long long may not work correctly
Product: Red Hat Enterprise Linux 5 Reporter: H.J. Lu <hongjiu.lu>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact: BaseOS QE <qe-baseos-auto>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.2CC: mnowak, pmuller, syeghiay
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: i386   
OS: Linux   
URL: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37731
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-02 11:43:39 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:

Description H.J. Lu 2008-10-06 14:53:53 UTC
This patch

http://gcc.gnu.org/ml/gcc-patches/2005-03/msg01296.html

caused

[hjl@gnu-31 longlong-2]$ cat y.c
#include <stdio.h>

extern void abort ();

unsigned long long xh = 1ull;

int
main ()
{
  unsigned long long yh = 0xffffffffull;
  unsigned long long z = xh * yh;
  unsigned long long i = 1ull * yh;

  printf ("%llx\n", i);
  printf ("%llx\n", z);
  if (z != i)
    abort ();
}
[hjl@gnu-31 longlong-2]$ gcc -m32 -O y.c
[hjl@gnu-31 longlong-2]$ ./a.out 
ffffffff
ffffffffffffffff
Aborted
[hjl@gnu-31 longlong-2]$ 

A possible patch is at

http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00128.html

Comment 9 errata-xmlrpc 2009-09-02 11:43:39 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1376.html