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.
---
 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 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

-- 
Alexandre Oliva, happy hacker                https://FSFLA.org/blogs/lxo/
   Free Software Activist                       GNU Toolchain Engineer
Disinformation flourishes because many people care deeply about injustice
but very few check the facts.  Ask me about <https://stallmansupport.org>

Reply via email to