-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Medium
-
Code Generation Tools
-
CODEGEN-15934
-
-
-
default
This bug only occurs when the data type returned by the function (going into the intrinsic) is a class, struct or union type and that the class, struct or union is smaller than the vector width of the target.
For example, this code may cause the bug.
```c
__HWA_CONFIG_REG_v1 config = (...);
__HWAOPEN(config, __gen_HWA_OFFSET_REG(), __MMA_OPEN_FSM_RESET);
```
(`HWAOPEN` is an intrinsic that expects an `HWA_OFFSET_REG` struct as its second argument. The `gen_HWA_OFFSET_REG()` function returns that type of data)
One workaround is to move the function call out into a new variable:
```c
__HWA_CONFIG_REG_v1 config = (...);
__HWA_OFFSET_REG offset_reg = __gen_HWA_OFFSET_REG();
__HWAOPEN(config, offset_reg, __MMA_OPEN_FSM_RESET);
```