21 Star 27 Fork 151

src-openEuler/gcc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0089-StructReorderFields-Fix-gimple-call-not-rewritten.patch 1.71 KB
一键复制 编辑 原始数据 按行查看 历史
From 302b7e15d6308c29c215db4c9901342e1106381a Mon Sep 17 00:00:00 2001
From: huang-xiaoquan <huangxiaoquan1@huawei.com>
Date: Mon, 29 Apr 2024 11:00:12 +0800
Subject: [PATCH] [StructReorderFields] Fix gimple call not rewritten due to
empty function node
Add parameter type escape for empty functions or inline functions.
---
gcc/ipa-struct-reorg/ipa-struct-reorg.cc | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/gcc/ipa-struct-reorg/ipa-struct-reorg.cc b/gcc/ipa-struct-reorg/ipa-struct-reorg.cc
index e08577c0c..2257d3528 100644
--- a/gcc/ipa-struct-reorg/ipa-struct-reorg.cc
+++ b/gcc/ipa-struct-reorg/ipa-struct-reorg.cc
@@ -4366,6 +4366,17 @@ ipa_struct_reorg::maybe_record_call (cgraph_node *node, gcall *stmt)
argtype = argtype ? TREE_CHAIN (argtype) : NULL_TREE;
}
+
+ /* Types escapes via a argument at empty or inlined function. */
+ cgraph_node *callee = node->get_edge (stmt)->callee;
+ if (!gimple_call_builtin_p (stmt, BUILT_IN_FREE)
+ && gimple_call_num_args (stmt)
+ && callee && (!callee->has_gimple_body_p () || callee->inlined_to))
+ {
+ for (unsigned i = 0; i < gimple_call_num_args (stmt); i++)
+ mark_type_as_escape (TREE_TYPE (gimple_call_arg (stmt, i)),
+ escape_var_arg_function);
+ }
}
void
@@ -8068,6 +8079,11 @@ ipa_struct_reorg::rewrite_functions (void)
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "\nNo rewrite:\n");
+ if (current_function_decl == NULL)
+ {
+ fprintf (dump_file, "\ncurrent_function_decl == NULL\n");
+ continue;
+ }
if (current_function_decl)
dump_function_to_file (current_function_decl, dump_file,
dump_flags | TDF_VOPS);
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/gcc.git
git@gitee.com:src-openeuler/gcc.git
src-openeuler
gcc
gcc
master

搜索帮助