From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5554 invoked by alias); 8 May 2007 21:30:12 -0000 Received: (qmail 5384 invoked by uid 22791); 8 May 2007 21:30:00 -0000 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 08 May 2007 21:29:57 +0000 Received: from sunsite.mff.cuni.cz (localhost.localdomain [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.8/8.13.8) with ESMTP id l48LcG4d007131; Tue, 8 May 2007 23:38:16 +0200 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.13.8/8.13.8/Submit) id l48LcGLS007130; Tue, 8 May 2007 23:38:16 +0200 Date: Tue, 08 May 2007 21:30:00 -0000 From: Jakub Jelinek To: Ulrich Drepper , "H. J. Lu" Cc: Glibc hackers Subject: [PATCH] Fix ia64 feraiseexcept Message-ID: <20070508213815.GA1826@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2007-05/txt/msg00005.txt.bz2 Hi! While feraiseexcept (FE_OVERFLOW); or feraiseexcept (FE_UNDERFLOW) are allowed to raise additionally inexact exception, feraiseexcept (FE_INEXACT) shouldn't raise any exception but inexact. DBL_MAX + 1.0 overflows and is inexact though, while (DBL_MAX / 2.0) + 1.0 is only inexact, but doesn't overflow. Fixes test-fenv. 2007-05-08 Jakub Jelinek * sysdeps/ia64/fpu/fraiseexcpt.c (feraiseexcept): Don't raise overflow exception in addition to inexact when asked to raise only FE_INEXACT. --- libc/sysdeps/ia64/fpu/fraiseexcpt.c.jj 2003-11-29 08:28:46.000000000 +0100 +++ libc/sysdeps/ia64/fpu/fraiseexcpt.c 2007-05-08 23:22:55.000000000 +0200 @@ -1,5 +1,6 @@ /* Raise given exceptions. - Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 2000, 2001, 2002, 2007 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jes Sorensen , 2000. @@ -69,7 +70,7 @@ feraiseexcept (int excepts) /* Last: inexact. */ if (FE_INEXACT & excepts) { - dummy = DBL_MAX; + dummy = DBL_MAX / 2.0; __asm__ __volatile__ ("fadd.d.s0 %0=%1,f1" : "=f" (dummy) : "0" (dummy)); } Jakub