From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by sourceware.org (Postfix) with ESMTPS id 35C603858D37; Thu, 1 Sep 2022 16:24:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 35C603858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-x330.google.com with SMTP id m17-20020a7bce11000000b003a5bedec07bso1705047wmc.0; Thu, 01 Sep 2022 09:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date; bh=3IH/s0FRqroHHbzxcGDyArsJdzGNQbW80vIpy4F5ooA=; b=WJsBtlZeFgNRTrlzEffKizZtu6gEWbGWpxv3s2QyfM7aLRi1elrh3Wtlsi/Pof6iXT mCwTRE68xDTmEW8QRzfgVyhhqWSykNiTVxUbNGb6XRZDuss35BRLriHsW4f8nLywx1bh OVtunK+O2rs29gsg4NKe4QB+EwbXaoHJF+AmUNpYh1WofcNFOxJkkA7b/NCE4EbIDHY7 /69MJF3DnZjaf0bHpzkLe+fnqFUwVaLxQRTTQ+IksUhCHcSmwR5n3+2BRHVcUVirAOvY yQkRerNfJIZUr/FQnPS0SxJ8r+PbWj5AYhF5kXM7aYLYeHCb92buXOA8M4hRK0NzoxHn GV9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=3IH/s0FRqroHHbzxcGDyArsJdzGNQbW80vIpy4F5ooA=; b=gwTbgNfMZdgO2n2iWFSsfkTpF+J3h0Fe82iaFpKC4iBVKMKnV08xhLaF8NpZ9zaAKT JQSvAAOaIiEMDsDC3v6i+oiRcE9XKlCQg8KNyLESsd3+GDaa0U+WJVDGly+2TdS+VAxD VpoeOGs1II/3KXk/6wAiM1QOvlg/kX8tuhkxEZXfXy/aNdUXSqXcln6ElA4guKkgDYuR PKtC916dLkhIqMFIU6R3ro19vgXnaI13tLxAyrbxHgf0CO5g4Hq0rQzcQ4+01IPqXZWO uQNBoF+DW5xLlGgaPq6S+LYVGVYoyMVbyiKyafzCWNg6e8evCXkb/YRS99AbxCxiByyf um/A== X-Gm-Message-State: ACgBeo1C2U7R8bq5K5qEA1cQaovGh9mGXC03KYV6ItYIkRvROJlo3zBR LNRyow/EN9a7bwJr3jjNi2c= X-Google-Smtp-Source: AA6agR4dzFJspc5oUrLAbIe4RtTzMia9+0DHDitXVYSFhz4L46K3NPuL4V0I+WhojrV+mMZLrbkupQ== X-Received: by 2002:a05:600c:1c23:b0:3a5:d936:e5bb with SMTP id j35-20020a05600c1c2300b003a5d936e5bbmr5430891wms.59.1662049487579; Thu, 01 Sep 2022 09:24:47 -0700 (PDT) Received: from smtpclient.apple ([2a01:e34:ec28:8cb0:4043:c6cc:4e14:1048]) by smtp.gmail.com with ESMTPSA id v12-20020adfebcc000000b00224f5bfa890sm15006382wrn.97.2022.09.01.09.24.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Sep 2022 09:24:46 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: Floating-point comparisons in the middle-end From: FX In-Reply-To: Date: Thu, 1 Sep 2022 18:24:46 +0200 Cc: Jakub Jelinek , gcc@gcc.gnu.org, FX via Fortran Content-Transfer-Encoding: quoted-printable Message-Id: <121CB5DE-35AD-4A8A-86A2-D74016CC8F87@gmail.com> References: <8C6DDAA3-A40F-47C7-BE78-D56A3EC70C71@gmail.com> <3BD50DD7-5C9E-42CB-992C-A66584411A4F@gmail.com> To: Joseph Myers X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Presumably that can be reproduced without depending on the new = built-in=20 > function? In which case it's an existing bug somewhere in the = optimizers. Yes: $ cat a.c #include #include #include void foo (void) { if (fetestexcept (FE_INVALID) & FE_INVALID) printf("Invalid raised\n"); feclearexcept (FE_ALL_EXCEPT); } static inline int iseqsig(float x, float y) { return (x >=3D y && x <=3D = y); } int main (void) { float x =3D __builtin_nanf(""); float y; printf("%d\n", iseqsig(__builtin_nanf(""), 1.)); foo(); printf("%d\n", iseqsig(x, __builtin_inff())); foo(); } $ ./bin/gcc a.c -lm -fno-unsafe-math-optimizations -frounding-math = -fsignaling-nans -O0 && ./a.out 0 Invalid raised 0 Invalid raised $ ./bin/gcc a.c -lm -fno-unsafe-math-optimizations -frounding-math = -fsignaling-nans -O1 && ./a.out 0 0 Do you want me to file a bug report? FX=