From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E5290389247E; Tue, 12 Jan 2021 10:05:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E5290389247E From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/98629] [11 Regression] ice during GIMPLE pass: widening_mul Date: Tue, 12 Jan 2021 10:05:59 +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: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.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 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: Tue, 12 Jan 2021 10:06:00 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98629 --- Comment #4 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:24ea113f75cfad38894dc1ad16b23c0538ef17d4 commit r11-6610-g24ea113f75cfad38894dc1ad16b23c0538ef17d4 Author: Jakub Jelinek Date: Tue Jan 12 11:04:46 2021 +0100 widening_mul: Fix up ICE caused by my signed multiplication overflow pattern recognition changes [PR98629] As the testcase shows, my latest changes caused ICE on that testcase. The problem is that arith_overflow_check_p now can change the use_stmt argument (has a reference), so that if it succeeds (returns non-zero), it points it to the GIMPLE_COND or EQ/NE or COND_EXPR assignment from t= he TRUNC_DIV_EXPR assignment. The problem was that it would change use_stmt also if it returned 0 in = some cases, such as multiple imm uses of the division, and in one of the cal= lers if arith_overflow_check_p returns 0 it looks at use_stmt again and perf= orms other checks, which of course assumes that use_stmt is the one passed to arith_overflow_check_p and not e.g. NULL instead or some other unrel= ated stmt. The following patch fixes that by only changing use_stmt when we are ab= out to return non-zero (for the MULT_EXPR case, which is the only one with = the need to use different use_stmt). 2021-01-12 Jakub Jelinek PR tree-optimization/98629 * tree-ssa-math-opts.c (arith_overflow_check_p): Don't update use_stmt unless returning non-zero. * gcc.c-torture/compile/pr98629.c: New test.=