From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A84AC3850428; Wed, 26 May 2021 08:21:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A84AC3850428 From: "aldyh at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/100499] Different results with -fpeel-loops -ftree-loop-vectorize options Date: Wed, 26 May 2021 08:21:12 +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: 10.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: aldyh at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: amker at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2021 08:21:12 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100499 --- Comment #24 from Aldy Hernandez --- (In reply to Aldy Hernandez from comment #23) > The above yields overflow for the 16-bit expression in question: >=20 > (gdb) p debug(top) > g_2823_lsm.5_6 * 7854 + 57682 >=20 > (gdb) p may_overflow_p (top) > $6 =3D true >=20 > This is because the range of the above expression in unsigned 16-bit yiel= ds > VARYING (R), whereas in 32-bit unsigned yields [57682, 514769572] (W). Which, I will note, matches Andrew's hand calculation of: >so the original expression is in 16 bit math, and if it was evaluated as > [0, 65535] * [7854, 7854] + [57682, 57682] > in 32 bit precision, it would come back with the answer [57682, 514769572= ].=