Bug 465807 - [Regression] long long may not work correctly
Summary: [Regression] long long may not work correctly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: gcc
Version: 5.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Jakub Jelinek
QA Contact: BaseOS QE
URL: http://gcc.gnu.org/bugzilla/show_bug....
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-10-06 14:53 UTC by H.J. Lu
Modified: 2009-09-02 11:43 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-02 11:43:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1376 0 normal SHIPPED_LIVE gcc bug fix update 2009-09-01 11:41:20 UTC

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


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