From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EC1A13858425; Wed, 21 Dec 2022 12:11:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC1A13858425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671624712; bh=eVMu00Pox9BhGtiHBU6E+xLZsK0Tt1m6cpodDPFPOGE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aNCTqzkjz+c2oCYSPa0AiCIk8PH6s6uACK3hUQE7cPlsV5uC7M2j4gfJw9g1RlIHn ZqkBK4g6EQXOYDcLZeTlbk/RwmocJRPqYCwxJZZTn79KanLLM22juqCE/lZeHY7f/x RhQ8vPL0n2M1M6SnTbCndAHHVGzzjKvWZkvvIA9Y= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108068] [10/11/12/13 Regression] decimal floating point signed zero is not honored Date: Wed, 21 Dec 2022 12:11:52 +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: 12.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc priority 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=3D108068 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jsm28 at gcc dot gnu.org, | |rguenth at gcc dot gnu.org Priority|P3 |P2 --- Comment #2 from Richard Biener --- Optimizing statement if (_5 !=3D 0) Visiting conditional with predicate: if (_5 !=3D 0) With known ranges _5: [unsupported_range] UNDEFINED Predicate evaluates to: DON'T KNOW LKUP STMT _5 ne_expr 0 0>>> COPY _5 =3D 0 <<<< COPY _5 =3D 0 the issue is we do bool can_infer_simple_equiv =3D !(HONOR_SIGNED_ZEROS (op1) && (TREE_CODE (op1) =3D=3D SSA_NAME || real_zerop (op1)= )); but real_zerop is false for Decimal zero. That's because "Trailing zeroes matter for decimal float constants, so don't return 1 for them.". We'd need a real_maybe_zerop () for this usage. We have other !real_zerop checks in match.pd and elsewhere, those are susceptible as well. Joseph, do you think adding DECIMAL_FLOAT_MODE_P checks in users is what we want to do or do you think a real_nonzerop would be more appropriate here? I guess DOM want's to ask whether op1 may compare equal to zero.=