Hi, The constant propagation pass propagates constants into the instructions that accept immediates. I'm trying to find if there's some CSE pass in GCC that would be able to undo this effect when the constant is used more than once in the function. I looked at the CSE code (4.5 branch) and I don't think this is currently possible. If the code uses a bunch of big constants, the effect on code size might be quite sensible.
I hacked around that in a quite horrible manner: I arranged for the immediate alternative of some insn patterns to be invalid during the 'cprop' passes. That way cprop doesn't put the immediate into the instructions, but if the constant is used only once it will be propagated into the instruction by the 'combine' pass. This seems excessively hackish to me, I wanted to know if there's some better/standard way to handle that issue. Thanks, Fred