---
title: 选项 -fipa-struct-dfc,-fipa-struct-dfc-bitfield,-fipa-struct-dfc-shadow
description: "- -fipa-struct-dfc: 使能结构体动态成员压缩优化，克隆部分原程序作为新的程序分支，在新分支中对接收运行时输入数据的结构体成员进行启发式压缩，根据运行时对输入数据范围的检查结果决定是否进入新分支"
url: https://www.hikunpeng.com/document/detail/zh/kunpengdevkithistory/hgcc/hist-hgcc/topic_0000002384398197.html
sourcePath: /source/zh/kunpengdevkithistory/hgcc/hist-hgcc/topic_0000002384398197.html
indexId: da7459158437b0fbbfaca323514ff155517010e8af270584d82128795072e47474
---
# 选项 -fipa-struct-dfc,-fipa-struct-dfc-bitfield,-fipa-struct-dfc-shadow

#### 说明

- -fipa-struct-dfc: 使能结构体动态成员压缩优化，克隆部分原程序作为新的程序分支，在新分支中对接收运行时输入数据的结构体成员进行启发式压缩，根据运行时对输入数据范围的检查结果决定是否进入新分支
- -fipa-struct-dfc-bitfield: 结构体动态成员压缩优化子选项，开启后可启发式地选择一个待压缩的目标成员并将其压缩成位域
- -fipa-struct-dfc-shadow: 结构体动态成员压缩优化子选项，开启后使能动态成员隐藏优化，使用更优的策略隐藏重复成员


#### 使用方法

在编译选项中加入：

```
-O3 -flto -flto-partition=one -fipa-struct-reorg=2 -fipa-struct-dfc -fipa-struct-dfc-bitfield -fipa-struct-dfc-shadow
```

-fipa-struct-dfc 选项需要在开启 -O3 -flto -flto-partition=one 以及 -fipa-struct-reorg 等级大于 2（或使用 -fipa-reorder-fields） 的基础上才能使能。

-fipa-struct-dfc-bitfield, -fipa-struct-dfc-shadow 选项需要在开启 -fipa-struct-dfc 的基础上才能使能。
