aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2022-12-29 14:32:53 -0300
committerAlexandre Oliva <oliva@gnu.org>2022-12-29 14:39:46 -0300
commite2535c6035270c8b46491c6d33285ac29362bdf7 (patch)
tree1214b7fba792636de4603c1b1d6c529ad3a15e76
parent8251f319439ff9ae0816d31db861b8681c953fc1 (diff)
downloadgcc-e2535c6035270c8b46491c6d33285ac29362bdf7.zip
gcc-e2535c6035270c8b46491c6d33285ac29362bdf7.tar.gz
gcc-e2535c6035270c8b46491c6d33285ac29362bdf7.tar.bz2
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.
-rw-r--r--gcc/tree-ssa-loop-niter.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-niter.cc b/gcc/tree-ssa-loop-niter.cc
index fece876..1764564 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