From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) by listman.redhat.com (Postfix) with ESMTP id 446642F056 for ; Wed, 20 Sep 2000 04:04:26 -0400 (EDT) Received: (from mail@localhost) by mail.redhat.com (8.8.7/8.8.7) id EAA01623 for axp-list@listman.redhat.com; Wed, 20 Sep 2000 04:04:26 -0400 Received: from voicenet.com (mail11.voicenet.com [207.103.0.37]) by mail.redhat.com (8.8.7/8.8.7) with SMTP id EAA01619 for ; Wed, 20 Sep 2000 04:04:25 -0400 Received: (qmail 26004 invoked from network); 20 Sep 2000 08:04:23 -0000 Received: from dialpool0103-pri.voicenet.com (HELO voicenet.com) (209.71.85.3) by mail11.voicenet.com with SMTP; 20 Sep 2000 08:04:23 -0000 Message-ID: <39C86CF1.A65D3819@voicenet.com> Date: Wed, 20 Sep 2000 02:53:21 -0500 From: Uncle George Organization: GatWorks X-Mailer: Mozilla 4.72 [en] (X11; I; Linux 2.2.14-6.0 alpha) X-Accept-Language: en MIME-Version: 1.0 To: axp-list@redhat.com Subject: Re: Alpha/Linux FP denormal processing References: <200009192302.SAA12426@polya.math.purdue.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0beta4 Precedence: bulk Reply-To: axp-list@redhat.com List-Id: Linux and Red Hat on Alpha processors I was thinking more of this: int main() { double div = 1.0, dis = 2.0; start( div, dis ); } start( double div, double dis ) { double x; for (x = div; x != 0.0; x /= dis) printf("%e\n", x); } even with -O2, it fails here. Brad Lucier wrote: > > > > > > > > -O2 converts the divide by 2 to a multiplication by 0.5, and so > > > avoids the error. > > > > Yes, indeed. Even '-O' is good enough and '-O0' will expose the problem. > > > > OTOH compiling anything with gcc and without optimization is a pure > > masochism and only a check that a code generator indeed does exist; > > so I did not even considered that somebody may want to use that > > to compile something for running. > > > > Michal > > Huh? This fails with -O2, too: > > popov-325% cat denormtest.c > #include > #include > > int main(int argc, char **argv) > { > double x = 1.0; > double y; > y = atof(argv[1]); > for (x = 1.0; x != 0.0; x /= y) > printf("%e\n", x); > return 0; > } > popov-326% gcc -O2 -Wall -o denormtest denormtest.c > popov-327% ./denormtest 2.0 | tail > 1.139238e-305 > 5.696189e-306 > 2.848095e-306 > 1.424047e-306 > 7.120236e-307 > 3.560118e-307 > 1.780059e-307 > 8.900295e-308 > 4.450148e-308 > 2.225074e-308 > > Brad Lucier > > _______________________________________________ > Axp-list mailing list > Axp-list@redhat.com > https://listman.redhat.com/mailman/listinfo/axp-list