From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6015 invoked by alias); 24 Aug 2006 13:03:30 -0000 Received: (qmail 5957 invoked by uid 48); 24 Aug 2006 13:03:12 -0000 Date: Thu, 24 Aug 2006 13:03:00 -0000 Message-ID: <20060824130312.5956.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/28796] __builtin_nan() and __builtin_unordered() inconsistent In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" 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 X-SW-Source: 2006-08/txt/msg02032.txt.bz2 List-Id: ------- Comment #15 from rguenth at gcc dot gnu dot org 2006-08-24 13:03 ------- One problem is that in fold-const.c we use HONOR_XXX macros, while in builtins.c folding we use MODE_HAS_XXX. HONOR_XXX changes with -ffinite-math-only and friends, while MODE_HAS_XXX not (of course). So to make behavior consistent, we need to switch either use to the other scheme. Meanwhile I also spotted case BUILT_IN_FINITE: if (!MODE_HAS_NANS (TYPE_MODE (TREE_TYPE (arg))) && !MODE_HAS_INFINITIES (TYPE_MODE (TREE_TYPE (arg)))) return omit_one_operand (type, integer_zero_node, arg); which needs to read integer_one_node as result. Fortunately modes with no nans don't come along here that often. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28796