Message ID | ork02dfpbv.fsf@lxoliva.fsfla.org |
---|---|
State | New |
Headers | show |
Series | [01/13] scoped tables: insert before further lookups | expand |
On 12/26/22 21:22, Alexandre Oliva via Gcc-patches wrote: > > When a TREE_OPERAND is NULL, do not cache it. > > Regstrapped on x86_64-linux-gnu. Ok to install? > > > for gcc/ChangeLog > > * tree-ssa-loop-niter.cc (expand_simple_operands): Refrain > from caching NULL TREE_OPERANDs. I must admit some curiosity about the NULL operand though. Do you recall what kind of node had a NULL operand and whether or not that was a valid state or not? I just want to make sure this isn't just papering over a deeper issue. jeff
Hello, Jeff, On Dec 27, 2022, Jeff Law <jeffreyalaw@gmail.com> wrote: >> * tree-ssa-loop-niter.cc (expand_simple_operands): Refrain >> from caching NULL TREE_OPERANDs. > I must admit some curiosity about the NULL operand though. Do you > recall what kind of node had a NULL operand and whether or not that > was a valid state or not? I'm pretty sure the case I hit was a CALL_EXPR. Thanks for the reviews! Happy GNU Year!
diff --git a/gcc/tree-ssa-loop-niter.cc b/gcc/tree-ssa-loop-niter.cc index fece876099c16..17645648326e8 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<tree, tree> &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