Bug#280972: marked as done ([PR 18694] [4.0 regression] loop miscompilation at -O1)
Your message dated Tue, 18 Jan 2005 10:45:44 +0100
with message-id <16876.56008.94094.751225@gargle.gargle.HOWL>
and subject line fixed in gcc-4.0_4.0-0pre4
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.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--------------------------------------
Received: (at submit) by bugs.debian.org; 12 Nov 2004 21:27:58 +0000
>From Bill.Allombert@math.u-bordeaux1.fr Fri Nov 12 13:27:58 2004
Return-path: <Bill.Allombert@math.u-bordeaux1.fr>
Received: from smail.math.u-bordeaux1.fr [147.210.16.22]
by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
id 1CSixZ-0006E4-00; Fri, 12 Nov 2004 13:27:57 -0800
Received: from localhost (guismo.drimm.u-bordeaux1.fr [147.210.36.243])
by localhost.math.u-bordeaux1.fr (Postfix) with ESMTP
id 367851820C; Fri, 12 Nov 2004 22:27:26 +0100 (CET)
Received: from smail.math.u-bordeaux1.fr ([147.210.16.22])
by localhost (guismo [147.210.36.243]) (amavisd-new, port 10024) with SMTP
id 03639-08; Fri, 12 Nov 2004 22:27:24 +0100 (CET)
Received: from pari (pari.math.u-bordeaux1.fr [147.210.16.88])
by smail.math.u-bordeaux1.fr (Postfix) with ESMTP
id 12A7C18123; Fri, 12 Nov 2004 22:27:24 +0100 (CET)
Received: from localhost.localdomain
([127.0.0.1] helo=pari.math.u-bordeaux.fr ident=mail)
by pari with smtp (Exim 3.35 #1 (Debian))
id 1CSix1-0000wV-00; Fri, 12 Nov 2004 22:27:23 +0100
Received: (nullmailer pid 3625 invoked by uid 1000);
Fri, 12 Nov 2004 21:27:23 -0000
Date: Fri, 12 Nov 2004 22:27:23 +0100
From: Bill Allombert <ballombe@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: gcc-snapshot generate incorrect code with -O1 and up.
Message-ID: <20041112212723.GA1372@pari.math.u-bordeaux.fr>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG"
Content-Disposition: inline
X-Reportbug-Version: 3.2
User-Agent: Mutt/1.5.6+20040907i
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: amavisd-new at u-bordeaux1.fr
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE
autolearn=no version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level:
--OgqxwSJOaUobr8KG
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Package: gcc-snapshot
Version: 20041030-1
Severity: normal
Hello Matthias,
gcc-snapshot generate incorrect code for the attached file with
-O1 and above. It is correctly compiled with -O0.
%gcc div.c -O0
%./a.out
1 2 4 8 5 10 20 40 25 50 100 200 125 250 500 1000
%gcc div.c -O1
%./a.out
1 2 5 10 1073835008 -1021043573 1073789904 -1073742211 134518760 15757829=
08 0 0
1073789904 0 1814429448 0
gcc 3.3 and 3.4 compile it correctly at -O3.
Cheers,
Bill.
-- System Information:
Debian Release: 3.1
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.4.26-acpi
Locale: LANG=3Dfran=E7ais, LC_CTYPE=3Dfran=E7ais (charmap=3DISO-8859-1)
Versions of packages gcc-snapshot depends on:
ii binutils 2.15-4 The GNU assembler, linker an=
d bina
ii libart-2.0-2 2.3.16-6 Library of functions for 2D =
graphi
ii libatk1.0-0 1.6.1-5 The ATK accessibility toolki=
t
ii libc6 2.3.2.ds1-18 GNU C Library: Shared librar=
ies an
ii libglib2.0-0 2.4.7-1 The GLib library of C routin=
es
ii libgtk2.0-0 2.4.13-1 The GTK+ graphical user inte=
rface=20
ii libpango1.0-0 1.4.1-4 Layout and rendering of inte=
rnatio
ii zlib1g 1:1.2.2-3 compression library - runtim=
e
-- no debconf information
--OgqxwSJOaUobr8KG
Content-Type: text/x-csrc; charset=us-ascii
Content-Disposition: attachment; filename="div.c"
#include <stdlib.h>
#include <stdio.h>
typedef long *GEN;
GEN stoi(long n)
{
GEN z=(GEN)calloc(3,sizeof(GEN));
z[2]=n;
return z;
}
GEN mulii(GEN x, GEN y) { return stoi(x[2]*y[2]); }
void
divisors_bug(long l, GEN *t, GEN e, GEN P)
{
long i, j;
GEN *d, *t1, *t2, *t3;
d = t;
*++d = stoi(1);
for (i=1; i<l; i++)
for (t1=t,j=e[i]; j; j--)
{
for (t2=d, t3=t1; t3<t2; )
*++d = mulii(*++t3, (GEN)P[i]);
t1=t2;
}
}
int main(void)
{
long e[3]={0,3,3};
long P[3]={0,(long)stoi(2),(long)stoi(5)};
GEN t[17];
long i;
divisors_bug(3,t,e,P);
for(i=1;i<17;i++)
printf("%ld ",t[i][2]);
printf("\n");
return 0;
}
--OgqxwSJOaUobr8KG--
---------------------------------------
Received: (at 280972-done) by bugs.debian.org; 18 Jan 2005 09:45:51 +0000
>From doko@cs.tu-berlin.de Tue Jan 18 01:45:50 2005
Return-path: <doko@cs.tu-berlin.de>
Received: from mail.cs.tu-berlin.de [130.149.17.13] (root)
by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
id 1Cqpvq-0008Fa-00; Tue, 18 Jan 2005 01:45:50 -0800
Received: from mailhost.cs.tu-berlin.de (postfix@mail.cs.tu-berlin.de [130.149.17.13])
by mail.cs.tu-berlin.de (8.9.3p2/8.9.3) with ESMTP id KAA23372
for <280972-done@bugs.debian.org>; Tue, 18 Jan 2005 10:45:45 +0100 (MET)
Received: from localhost (localhost [127.0.0.1])
by mailhost.cs.tu-berlin.de (Postfix) with ESMTP id D81F1F21A
for <280972-done@bugs.debian.org>; Tue, 18 Jan 2005 10:45:44 +0100 (MET)
Received: from mailhost.cs.tu-berlin.de ([127.0.0.1])
by localhost (bueno [127.0.0.1]) (amavisd-new, port 10224) with ESMTP
id 01470-36 for <280972-done@bugs.debian.org>;
Tue, 18 Jan 2005 10:45:44 +0100 (MET)
Received: from bolero.cs.tu-berlin.de (bolero.cs.tu-berlin.de [130.149.19.1])
by mailhost.cs.tu-berlin.de (Postfix) with ESMTP
for <280972-done@bugs.debian.org>; Tue, 18 Jan 2005 10:45:44 +0100 (MET)
Received: (from doko@localhost)
by bolero.cs.tu-berlin.de (8.12.10+Sun/8.12.8/Submit) id j0I9ji7p003325;
Tue, 18 Jan 2005 10:45:44 +0100 (MET)
From: Matthias Klose <doko@cs.tu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <16876.56008.94094.751225@gargle.gargle.HOWL>
Date: Tue, 18 Jan 2005 10:45:44 +0100
To: 280972-done@bugs.debian.org
Subject: fixed in gcc-4.0_4.0-0pre4
X-Mailer: VM 7.03 under 21.4 (patch 6) "Common Lisp" XEmacs Lucid
X-Virus-Scanned: by amavisd-new at cs.tu-berlin.de
Delivered-To: 280972-done@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no
version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level:
fixed in gcc-4.0_4.0-0pre4
Reply to: