> Well ... I would have expected that we'd have folded the CONST_DECL to
> its DECL_INITIAL.  At least that is what we do for all other CONST_DECLs.
> The only way CONST_DECLs should appear in the IL (after some optimization
> of course) is when you take their address.

That's what (essentially) happens here.  The CONST_DECL is wrapped up in a 
VIEW_CONVERT_EXPR to array type and a component with non-constant index is 
extracted from it.

> So - if you can burn some extra cycles to figure out why it's not
> replaced by its DECL_INITIAL ...?

We specifically prevent that in gigi because it will need to be spilled to 
memory given the above access pattern, so I don't really see the problem.
Here's the access in .optimized:

_38 = MEM[symbol: pkg__zero_unit, index: ivtmp.38_27, step: 4, offset: -4B];

-- 
Eric Botcazou

Reply via email to