From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14124 invoked by alias); 21 Sep 2004 06:20:56 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 14105 invoked by alias); 21 Sep 2004 06:20:55 -0000 Date: Tue, 21 Sep 2004 06:20:00 -0000 Message-ID: <20040921062055.14104.qmail@sourceware.org> From: "dave at hiauly1 dot hia dot nrc dot ca" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040921015638.17578.danglin@gcc.gnu.org> References: <20040921015638.17578.danglin@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/17578] Missed optimization--failure of gcc.c-torture/execute/ieee/compare-fp-3.c at -O1 and above X-Bugzilla-Reason: CC X-SW-Source: 2004-09/txt/msg02356.txt.bz2 List-Id: ------- Additional Comments From dave at hiauly1 dot hia dot nrc dot ca 2004-09-21 06:20 ------- Subject: Re: Missed optimization--failure of gcc > ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-09-21 > 04:35 ------- > Actually by the C standard, compares do not trap at all. C99 indicates that relational operations may raise the invalid exception when argument values are NaNs. This includes both quiet and signalling NaNs. 5.2.4.2.2 paragraph 3 states that a signalling NaN generally raises an exception when used as an arithmetic operand. As far as I can tell, there is no exception in this regard for the equality operators. They are analogous to the relational operators except for being lower in precedence. Treating relational operators and equality operators differently with respect to signalling NaNs would present a significant problem on the PA-RISC architecture as all floating point comparisons behave in the same manner. >>From the C standard, it's somewhat ambiguous whether a quiet NaN should raise an exception in an equality operation. We currently don't raise an exception on the PA. The C standard allows for various floating point models but I don't think it was intended to be incompatible with IEC 60559:1989. There are various "is" macros which don't raise the invalid exception. Dave -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17578