From b2b710238e13eb2fced77d89cd8dcc86f77b6c6c Mon Sep 17 00:00:00 2001 From: benniaobufeijiushiji Date: Mon, 19 Dec 2022 15:12:24 +0800 Subject: [PATCH 2/3] [semi-relayout] Bugfix for struct semi-relayout Bugfix when relayout candidate type is null. --- gcc/ipa-struct-reorg/ipa-struct-reorg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-struct-reorg.c index 4751711fe..2cac340c7 100644 --- a/gcc/ipa-struct-reorg/ipa-struct-reorg.c +++ b/gcc/ipa-struct-reorg/ipa-struct-reorg.c @@ -6408,6 +6408,8 @@ ipa_struct_reorg::is_semi_relayout_candidate (tree xhs) { tree type = TREE_TYPE (mem); srtype *old_type = get_relayout_candidate_type (type); + if (!old_type) + return false; if (types_compatible_p (type, old_type->type) && old_type->semi_relayout) return true; -- 2.27.0.windows.1