]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Do not assume LHS of call is an ssa-name.
authorAndrew MacLeod <amacleod@redhat.com>
Wed, 12 Jun 2024 13:20:20 +0000 (09:20 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Fri, 14 Jun 2024 19:16:38 +0000 (15:16 -0400)
gimple_range_fold makes an assumption that the LHS of a call is an
ssa_name, which later in compilation may not be true.

* gimple-range-fold.cc (fold_using_range::range_of_call): Ensure
LHS is an SSA_NAME before invoking gimple_range_global.

gcc/gimple-range-fold.cc

index 6037c29ce11e3b9469f91842cca25b3fd0e44347..52fc3f2cb04a3b0dc665edb4de0544c5bb301ae8 100644 (file)
@@ -1105,7 +1105,7 @@ fold_using_range::range_of_call (vrange &r, gcall *call, fur_source &)
     }
 
   // If there is an LHS, intersect that with what is known.
-  if (lhs)
+  if (gimple_range_ssa_p (lhs))
     {
       Value_Range def (TREE_TYPE (lhs));
       gimple_range_global (def, lhs);