summaryrefslogtreecommitdiff
path: root/0095-Struct-reorg-Fix-the-use-of-as_a.patch
blob: 77a8880c9db4779c4be4af4d3711cb57cd1f2c0d (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From 1ab2b199a30db4ec605581a5a23b5c258a127db6 Mon Sep 17 00:00:00 2001
From: dingguangya <dingguangya1@huawei.com>
Date: Fri, 26 May 2023 09:27:38 +0800
Subject: [PATCH 4/5] [Struct reorg] Fix the use of as_a

The as_a function is an internal type conversion
function in gcc, which should be: gimple * ->gcond * when used,
so fix the problem with function usage at this.
---
 gcc/ipa-struct-reorg/ipa-struct-reorg.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-struct-reorg.c
index 2cac340c7..b0e4624b2 100644
--- a/gcc/ipa-struct-reorg/ipa-struct-reorg.c
+++ b/gcc/ipa-struct-reorg/ipa-struct-reorg.c
@@ -6607,8 +6607,7 @@ ipa_struct_reorg::compress_candidate_with_check (gimple_stmt_iterator *gsi,
   gimple_set_location (cond, UNKNOWN_LOCATION);
   gsi_insert_before (gsi, cond, GSI_SAME_STMT);
 
-  gimple* cur_stmt = as_a <gimple *> (cond);
-  edge e = split_block (cur_stmt->bb, cur_stmt);
+  edge e = split_block (cond->bb, cond);
   basic_block split_src_bb = e->src;
   basic_block split_dst_bb = e->dest;
 
@@ -6847,8 +6846,7 @@ ipa_struct_reorg::decompress_candidate_with_check (gimple_stmt_iterator *gsi,
   gsi_insert_before (gsi, cond, GSI_SAME_STMT);
 
   /* Split bb.  */
-  gimple* cur_stmt = as_a <gimple *> (cond);
-  edge e = split_block (cur_stmt->bb, cur_stmt);
+  edge e = split_block (cond->bb, cond);
   basic_block split_src_bb = e->src;
   basic_block split_dst_bb = e->dest;
 
@@ -7133,8 +7131,7 @@ ipa_struct_reorg::rewrite_pointer_plus_integer (gimple *stmt,
   gimple_set_location (cond, UNKNOWN_LOCATION);
   gsi_insert_before (gsi, cond, GSI_SAME_STMT);
 
-  gimple *curr_stmt = as_a <gimple *> (cond);
-  edge e = split_block (curr_stmt->bb, curr_stmt);
+  edge e = split_block (cond->bb, cond);
   basic_block split_src_bb = e->src;
   basic_block split_dst_bb = e->dest;
   remove_edge_raw (e);
-- 
2.33.0