From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 56F593858D38; Thu, 10 Nov 2022 12:54:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 56F593858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668084840; bh=+n+jQyhMz24m1rylWkGLyjSMwc5mhKKysYLBoDjOArI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NmZYNzuJxaGmyDVVAxx35utzwqElQGcMRCmfgwOT2KAALKIhmU23MVnU0tvh+Uvtq 4BnObmS5WrhzizjEb15ndwu9k3/dc/E2boQSTiOum6kk0aEeZ0O4lj58oZwkkfAJQy wJGM27brRn5SqWzsJvkwt+Mfa+26ykm/bxdwwtpw= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107569] [13 Regression] Failure to optimize std::isfinite since r13-3596 Date: Thu, 10 Nov 2022 12:54:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107569 --- Comment #28 from Jakub Jelinek --- (In reply to Aldy Hernandez from comment #27) > > As for signed zeros in -fsigned-zeros (default) mode, wonder if we e.g.= don't > > say sqrt is nonnegative (even when sqrt (-0.0) is -0.0). >=20 > It seems tree_call_nonnegative_warnv_p is already doing the right thing f= or > sqrt? >=20 > CASE_CFN_SQRT: > CASE_CFN_SQRT_FN: > /* sqrt(-0.0) is -0.0. */ > if (!HONOR_SIGNED_ZEROS (type)) > return true; > return RECURSE (arg0); Ah, ok. So, if we during stage3 go through all the cases and convince ourselves it is good enough, it might be ok for signed zeros then. Still t= he sign of NAN is separate question from that, and there we should set +NAN on= ly when we see CASE_CFN_FABS{,_FN} or ABS_EXPR, toggle the sign of NEGATE_EXPR, inherit fr= om second argument for CASE_CFN_COPYSIGN{,_FN} and copy over for copies.=