summaryrefslogtreecommitdiff
path: root/0301-Add-required-check-for-iteration-through-uses.patch
blob: 105f4f75616777a5f8e3437645f41c75bc7b5d2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From ca24d352e98e357f4f7b8f0d262201765705a08a Mon Sep 17 00:00:00 2001
From: Pronin Alexander <pronin.alexander@huawei.com>
Date: Thu, 31 Oct 2024 16:31:33 +0800
Subject: [PATCH 4/6] Add required check for iteration through uses

Signed-off-by: Pronin Alexander  <pronin.alexander@huawei.com>
---
 gcc/tree-ssa-math-opts.cc | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/gcc/tree-ssa-math-opts.cc b/gcc/tree-ssa-math-opts.cc
index 2c06b8a60..80c06fa01 100644
--- a/gcc/tree-ssa-math-opts.cc
+++ b/gcc/tree-ssa-math-opts.cc
@@ -4938,8 +4938,13 @@ convert_double_size_mul (gimple_stmt_iterator *gsi, gimple *stmt)
 
   /* Find the mult low part getter.  */
   FOR_EACH_IMM_USE_STMT (use_stmt, use_iter, match[3])
-    if (gimple_assign_rhs_code (use_stmt) == REALPART_EXPR)
-      break;
+    {
+      if (!is_gimple_assign (use_stmt))
+	continue;
+
+      if (gimple_assign_rhs_code (use_stmt) == REALPART_EXPR)
+	break;
+    }
 
   /* Create high and low (if needed) parts extractors.  */
   /* Low part.  */
-- 
2.33.0