From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 327A83858CDA; Thu, 10 Nov 2022 09:47:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 327A83858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668073676; bh=+k9YBrG7fxLkfyHBTGOTjLWaHYhK+poAwzTxzI7WzCI=; h=From:To:Subject:Date:From; b=MtK37kzRdCcQHsX/Df5GKVa+1WBuHxxPi/+ivP+YR5lMBlrIp0fqZ+tk+DUMrEFvA lyTwzDRFmWRFYNs0vbALkBL/VodmgCkFIknRr1/iZJyDUzAMaecExOs6dRQsWwxf7h YHh64Rrm7hz52W2jK8aEeH/DgLLaOzl60liUAg3A= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107608] New: [13 Regression] Failure on fold-overflow-1.c Date: Thu, 10 Nov 2022 09:47:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D107608 Bug ID: 107608 Summary: [13 Regression] Failure on fold-overflow-1.c Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: jakub at gcc dot gnu.org Target Milestone: --- With my https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107569#c20 patch I get +FAIL: gcc.dg/fold-overflow-1.c scan-assembler-times 2139095040 2 regression because float foo(void) { return __FLT_MAX__ + __FLT_MAX__; } no longer raises overflow exception. This case is canonicalized to return __FLT_MAX__ * 2.0f; and ranger correctly determines the result is [+Inf, +Inf], but then comes dom2 and happily replaces _1 =3D 3.4028234663852885981170418348451692544e+38 * 2.0e+0; return _1; with _1 =3D 3.4028234663852885981170418348451692544e+38 * 2.0e+0; return Inf; (I think this is still correct) and then dce3 removes the _1 =3D 3.4028234663852885981170418348451692544e+38 * 2.0e+0; statement. That is not correct, because -ftrapping-math is on and this multiplication is supposed to trap. Now, my patch isn't needed, if I do: float bar(void) { return __FLT_MAX__ + (__FLT_MAX__ / 4.0f); } instead, then the same regressed already on vanilla trunk: _1 =3D 3.4028234663852885981170418348451692544e+38 + 8.507058665963221495292604587112923136e+37; return _1; changes in dom2 to _1 =3D 3.4028234663852885981170418348451692544e+38 + 8.507058665963221495292604587112923136e+37; return Inf; and in dce3 to just return Inf;=