ssa-dom-cse-2.c fails on a number of platforms because the input array is pushed out to the constant pool, preventing later stages from folding away the entire computation. This patch series fixes the failure by extending SRA to pull the constants back in.
This is my first patch(set) to SRA and as such I'd appreciate suggestions about the approach. I think the first two patches, which essentially just extend SRA to deal with ARRAY_TYPE as well as RECORD_TYPE, are fairly straightforward and may stand alone. Later patches, in particular, may be better done in a different way and I'd welcome feedback as to what a patch (series) should look like. Also the heuristic for controlling SRA, when dealing with constant-pool loads, may want something better/other than the default --param sra-max-scalarization-size-O{speed,size}, or else platforms where the initializer is forced to memory, will still suffer in terms of constant propagation.