代码拉取完成,页面将自动刷新
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。