[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#20889: marked as done ([Fixed in upstream {gcc,egcc}-2.92.21] Inconsistent results got by gcc-optimized code)



Your message dated Thu, 12 Apr 2001 23:52:39 +0200 (MEST)
with message-id <15062.8940.590633.88211@bolero>
and subject line closing gcc272 bugs
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Darren Benham
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 9 Apr 1998 00:28:30 +0000
Received: (qmail 1875 invoked from network); 9 Apr 1998 00:28:28 -0000
Received: from maple.camas.org (HELO sizuka.bsj.com) (root@143.227.5.24)
  by debian.novare.net with SMTP; 9 Apr 1998 00:28:28 -0000
Received: from sizuka.bsj.com (logic@localhost [127.0.0.1])
	by sizuka.bsj.com (8.8.8/8.8.8/Debian/GNU) with ESMTP id QAA01011
	for <submit@bugs.debian.org>; Wed, 8 Apr 1998 16:29:55 -0700
Message-Id: <199804082329.QAA01011@sizuka.bsj.com>
To: submit@bugs.debian.org
From: Masami Takikawa <takikawm@cs.orst.edu>
Subject: Inconsistent results got by gcc-optimized code.
Date: Wed, 08 Apr 1998 16:29:43 -0700
Sender: logic@bsjnext.bsj.com

Package: gcc
Version: 2.7.2.3-4 and older

Also,
Package: g++
Version: 2.90.27-0.3

The following program produces different results depending on
whether -O flag is given.

$ cat bug.c
#include <stdio.h>

static double d1 = 31128881900274143232.0;
static double d2 =        1275889274032.0;
static double d3 = 31128880624384869200.0;

int main() {
  double d4;

  printf("%.20g %.20g %.20g\n", d1, d2, d3);

  d4 = d1 - d2;
  if (d3 < d4)
    printf("%.20g< %.20g\n", d3, d4);
  else
    printf("%.20g>=%.20g\n", d3, d4);

  printf("%.20g< %.20g = %d\n", d3, d4, (d3 <  d4));
  printf("%.20g==%.20g = %d\n", d3, d4, (d3 == d4));
  printf("%.20g> %.20g = %d\n", d3, d4, (d3 >  d4));

  return 0;
}
$ gcc bug.c
$ a.out
31128881900274143232 1275889274032 31128880624384868352
31128880624384868352>=31128880624384868352
31128880624384868352< 31128880624384868352 = 0
31128880624384868352==31128880624384868352 = 1
31128880624384868352> 31128880624384868352 = 0
$ gcc -O bug.c
$ a.out
31128881900274143232 1275889274032 31128880624384868352
31128880624384868352< 31128880624384868352
31128880624384868352< 31128880624384868352 = 0
31128880624384868352==31128880624384868352 = 1
31128880624384868352> 31128880624384868352 = 0

Note that the unoptimized code produces consistent results
while the optimized code produces inconsistent results.

I am using Debian 2.0, kernel-source-2 2.0.33-6,
and libc6 2.0.7pre1-4.wc.

Masami
---------------------------------------
Received: (at 20889-done) by bugs.debian.org; 12 Apr 2001 21:58:24 +0000
>From doko@cs.tu-berlin.de Thu Apr 12 16:58:24 2001
Return-path: <doko@cs.tu-berlin.de>
Received: from mail.cs.tu-berlin.de [130.149.17.13] (root)
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 14np6d-0003Xr-00; Thu, 12 Apr 2001 16:58:24 -0500
Received: from bolero.cs.tu-berlin.de (bolero.cs.tu-berlin.de [130.149.19.1])
	by mail.cs.tu-berlin.de (8.9.3/8.9.3) with ESMTP id XAA08192;
	Thu, 12 Apr 2001 23:53:09 +0200 (MET DST)
Received: (from doko@localhost)
	by bolero.cs.tu-berlin.de (8.9.3+Sun/8.9.3) id XAA19323;
	Thu, 12 Apr 2001 23:52:39 +0200 (MEST)
From: Matthias Klose <doko@cs.tu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Date: Thu, 12 Apr 2001 23:52:39 +0200 (MEST)
To: 4429-done@bugs.debian.org, 4430-done@bugs.debian.org,
        4954-done@bugs.debian.org, 5367-done@bugs.debian.org,
        6047-done@bugs.debian.org, 12375-done@bugs.debian.org,
        20606-done@bugs.debian.org, 20889-done@bugs.debian.org,
        24788-done@bugs.debian.org, 26100-done@bugs.debian.org,
        34322-done@bugs.debian.org, 48726-done@bugs.debian.org,
        54544-done@bugs.debian.org, 63154-done@bugs.debian.org
Subject: closing gcc272 bugs
X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs  Lucid
Message-ID: <15062.8940.590633.88211@bolero>
Delivered-To: 20889-done@bugs.debian.org

gcc272 (2.7.2.3-18) unstable; urgency=low

  * Close all gcc272 in the Debian bug tracking archive. The use of
    gcc272 is deprecated. The only reason it exists is to have a
    compiler for the linux kernel 2.0.x.
    The bug reports for gcc272 are still available on
    http://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=gcc272&archive=yes
    Closes: #4429, #4430, 4954, #5367, #6047, #12375, #20606, #20889,
    #24788, #26100, #34322, #48726, #54544, #63154.



Reply to: