From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7510E3857B8B; Tue, 8 Nov 2022 15:34:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7510E3857B8B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667921643; bh=MIj0qkw0az8RL6ju+U4Y3wFmj02aATMQdRhUdOYbOAc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Ra94xT/D9YbiNjzsii0yDcHxbeDXzNyc45dkqIlNsRxPGw9QfQJcxGwzKORdCUfBo xSwXXuwqko6xrY8z0pBBGNUFTTyt4Z3gElZhpH30aXiNzlzY4qOgW/+up/sJ07M/R5 VuStUuw7UWFTHvHnuduYVbFsG5BPTWlo6/Wdq+FQ= 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: Tue, 08 Nov 2022 15:34:02 +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 #6 from Jakub Jelinek --- __builtin_isfinite (x) is implemented as ~UNGT_EXPR, DBL_MAX>. So, if we have: _3 =3D ABS_EXPR ; _4 =3D _3 u> 1.79769313486231570814527423731704356798070567525844996599e+= 308; _5 =3D ~_4; return _5; for assume function, we should start with [1,1] assumption on _5, that impl= ies _4 [0,0], and from UNGT_EXPR being false, we should derive that _3 is [-inf, 1.79769313486231570814527423731704356798070567525844996599e+30= 8] and not NaN (if any operand is NaN, UNGT_EXPR is true, it stands for unorde= red or greater). And from _3 being [-inf, 1.79769313486231570814527423731704356798070567525844996599e+308] not NaN we should derive that x_2(D) is [-1.79769313486231570814527423731704356798070567525844996599e+308, 1.79769313486231570814527423731704356798070567525844996599e+308] not NaN (aka finite number).=