Not what is happening is an interaction between the inlining and the return slot optimization and the named value optimization.
Before inlining we have:
--- Cut ----
Since &(*copyBack.1_1).storage[0] is not a constant we get an ICE. Why we don't remove the extra cast to begin is questionable. If we change:
const Region copyBack(subtract(a));
to
const Region copyBack = (subtract(a));
Not what is happening is an interaction between the inlining and the return slot optimization and the named value optimization.
Before inlining we have:
# storage_1 = PHI <&<retval> .storage[ 0](2), &<retval> .storage[ 1](3)>
...
copyBack.1_1 = (struct Region *) ©Back;
*copyBack.1_1 ={v} subtract (a_2(D)) [return slot optimization];
--- Cut ---- 1_1).storage[ 0] is not a constant we get an ICE. Why we don't remove the extra cast to begin is questionable. If we change: subtract( a));
Since &(*copyBack.
const Region copyBack(
to
const Region copyBack = (subtract(a));
We can remove the cast and it works.