---
title: 选项 -fipa-struct-dfc,-fipa-struct-dfc-bitfield,-fipa-struct-dfc-shadow
description: "- -fipa-struct-dfc: 开启结构体动态成员压缩优化。该选项会克隆原程序的部分代码生成新的程序分支，在新分支中对接收运行时输入数据的结构体成员进行启发式压缩，根据运行时对输入数据范围的检查结果决定是否进入新分支。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengdevps/compilation/ug-hgcc/kunpenghgcc_06_0083.html
sourcePath: /source/zh/kunpengdevps/compilation/ug-hgcc/kunpenghgcc_06_0083.html
indexId: 1dfdbaa3c026fa0f3b0e4906d21148e8079804b9f5ae8b280397283b5c74fcab68
---
# 选项 -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的基础上才能使能。
