diff --git a/0084-StructReorderFields-Fix-gimple-call-not-rewritten.patch b/0084-StructReorderFields-Fix-gimple-call-not-rewritten.patch new file mode 100644 index 0000000000000000000000000000000000000000..76697e2a7118797125c20773ac6b2d05ad523662 --- /dev/null +++ b/0084-StructReorderFields-Fix-gimple-call-not-rewritten.patch @@ -0,0 +1,48 @@ +From 302b7e15d6308c29c215db4c9901342e1106381a Mon Sep 17 00:00:00 2001 +From: huang-xiaoquan +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 + diff --git a/gcc.spec b/gcc.spec index 215796890dc81ae32508cd8a0f977c7a92641407..f931a3865e6e76ac74de369369cea0985f4ebdd1 100644 --- a/gcc.spec +++ b/gcc.spec @@ -2,7 +2,7 @@ %global gcc_major 12 # Note, gcc_release must be integer, if you want to add suffixes to # %%{release}, append them after %%{gcc_release} on Release: line. -%global gcc_release 26 +%global gcc_release 27 %global _unpackaged_files_terminate_build 0 %global _performance_build 1 @@ -221,6 +221,7 @@ Patch80: 0080-x86-Update-model-values-for-Alderlake-Rocketlake-and.patch Patch81: 0081-x86-Update-model-values-for-Raptorlake.patch Patch82: 0082-Fix-target_clone-arch-graniterapids-d.patch Patch83: 0083-BUGFIX-AutoBOLT-function-miss-bind-type.patch +Patch84: 0084-StructReorderFields-Fix-gimple-call-not-rewritten.patch # Part 3000 ~ 4999 %ifarch loongarch64 @@ -3092,6 +3093,10 @@ end %doc rpm.doc/changelogs/libcc1/ChangeLog* %changelog +* Fri Aug 16 2024 huang-xiaoquan - 12.3.1-27 +- Type: BUGFIX +- DESC: StructReorderFields-Fix-gimple-call-not-rewritten. + * Thu Aug 15 2024 Zhenyu Zhao - 12.3.1-26 - Type: Sync - DESC: Sync patch from openeuler/gcc