From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id B9A3C3858C5E; Wed, 28 Dec 2022 05:23:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B9A3C3858C5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672204998; bh=Gx+rB9NtWC+Wgj1Zv293BHC+ignn/3C7b22ShaJ9Ijg=; h=From:To:Subject:Date:From; b=uV/SGMnXf1p8Rmk/G1/i45x6pb+WG7EXeg1TGTkhmzZzva7y639iuRvbJ40bYLahU 8I0YTa3Zf51J8+CJp9ocQshUxC27mWz+4ZmCu42mJcpHYCo4z63yCZbJew1UxO+b3Y baX7q2jPCz6Nj9eV/fQPOFw0B7Cu+itNJv9AcGUY= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] ssa-loop-niter: skip caching of null operands X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: 49cc30b889ba0d19c975d1709d456ee987051008 X-Git-Newrev: ab80e53a5b1f989514ba04e389f2a7498b13a595 Message-Id: <20221228052318.B9A3C3858C5E@sourceware.org> Date: Wed, 28 Dec 2022 05:23:18 +0000 (GMT) List-Id: https://gcc.gnu.org/g:ab80e53a5b1f989514ba04e389f2a7498b13a595 commit ab80e53a5b1f989514ba04e389f2a7498b13a595 Author: Alexandre Oliva Date: Wed Dec 28 02:21:34 2022 -0300 ssa-loop-niter: skip caching of null operands When a TREE_OPERAND is NULL, do not cache it. for gcc/ChangeLog * tree-ssa-loop-niter.cc (expand_simple_operands): Refrain from caching NULL TREE_OPERANDs. Diff: --- gcc/tree-ssa-loop-niter.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/tree-ssa-loop-niter.cc b/gcc/tree-ssa-loop-niter.cc index fece876099c..17645648326 100644 --- a/gcc/tree-ssa-loop-niter.cc +++ b/gcc/tree-ssa-loop-niter.cc @@ -2325,6 +2325,8 @@ expand_simple_operations (tree expr, tree stop, hash_map &cache) for (i = 0; i < n; i++) { e = TREE_OPERAND (expr, i); + if (!e) + continue; /* SCEV analysis feeds us with a proper expression graph matching the SSA graph. Avoid turning it into a tree here, thus handle tree sharing