diff options
Diffstat (limited to '0095-Struct-reorg-Fix-the-use-of-as_a.patch')
-rw-r--r-- | 0095-Struct-reorg-Fix-the-use-of-as_a.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/0095-Struct-reorg-Fix-the-use-of-as_a.patch b/0095-Struct-reorg-Fix-the-use-of-as_a.patch new file mode 100644 index 0000000..77a8880 --- /dev/null +++ b/0095-Struct-reorg-Fix-the-use-of-as_a.patch @@ -0,0 +1,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 + |