www.delorie.com/archives/browse.cgi   search  
Mail Archives: pgcc/1999/05/18/21:27:54

Date: Wed, 19 May 1999 05:24:53 +0400 (MSD)
From: "Dmitry V. Levin" <ldv AT fandra DOT org>
To: PGCC Mailing List <pgcc AT delorie DOT com>
Subject: Re: IA: pgcc-1.1.3 bug?
In-Reply-To: <19990516184117.A1193@cerebro.laendle>
Message-ID: <Pine.LNX.4.10.9905190456060.19598-100000@LDV.fandra.org>
MIME-Version: 1.0
Reply-To: pgcc AT delorie DOT com
X-Mailing-List: pgcc AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sun, 16 May 1999, Marc Lehmann wrote:

> On Wed, May 12, 1999 at 05:43:43AM +0400, Dmitry V. Levin wrote:
> > Compiler: pgcc-1.1.3 based on egcs-1.1.2 (from RedHat 6.0 SRPMS),
> >   built with only "-O2" optimization enabled.
> >   (as it have been said, pgcc-1.1.3 doesn't build with -march=i686)
> 
> I can't reproduce this :(. Which version, _exactly_ are you using?  Also:
> is the code fragment part of a larger program? Does the bug still happen
> when you compile it on your own?

$ gcc -v
Reading specs from /usr/lib/gcc-lib/i686-redhat-linux/pgcc-2.91.66/specs
gcc version pgcc-2.91.66 19990314/Linux (egcs-1.1.2 release)
$ rpm -qf `type -path gcc`
egcs-1.1.2-12.pgcc
(i.e. egcs-1.1.2-12 + egcs-1.1.2-pgcc-1.1.3.diff.bz2)


Well, posted code (which have been compiled as separate file) have been deduced
from file glibc/time/mktime.c (RedHat-6.0 glibc-2.1.1-6.src.rpm), in order to
locate reason of failure in internal test provided with mktime.c:

$ gcc -DDEBUG -DHAVE_LIMITS_H -DSTDC_HEADERS -Wall -W -O2 -march=i586 mktime.c -o mktime
$ ./mktime 1999-03-21 12:00:00
mktime returns 922006800 == 1999-03-21 12:00:00 yday 079 wday 0 isdst 0

$ gcc -DDEBUG -DHAVE_LIMITS_H -DSTDC_HEADERS -Wall -W -O2 -march=i686 mktime.c -o mktime
$ ./mktime 1999-03-21 12:00:00
mktime returns -1 == 1999-03-21 12:00:00 yday -1073743628 wday 134521548 isdst 
-1
mktime (1999-03-21 12:00:00 yday -1073743628 wday 134521548 isdst -1)
yields (1970-01-01 02:59:59 yday 000 wday 4 isdst 0) == -1, should be -1

$ gcc -DDEBUG -DHAVE_LIMITS_H -DSTDC_HEADERS -Wall -W -O0 -march=i686 mktime.c -o mktime
$ ./mktime 1999-03-21 12:00:00
mktime returns 922006800 == 1999-03-21 12:00:00 yday 079 wday 0 isdst 0

Regards,
	Dmitry

P.S. Since this problem appears only with i686 optimization, it could left
undetected by people optimizing only for i586, such as MandrakeSoft..

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019