------- Comment #9 from aldyh at gcc dot gnu dot org 2007-12-04 23:43 ------- TER would never see the consecutive initializations because the code I pointed out in gimplify_init_constructor() keeps the gimplifier from splitting up the constructor into consecutive MODIFY_EXPRs.
After gimplification we end up with: setup_foo () { static const struct foo init = {.a1=1, .a2=5}; thefoo = init; } So there's nothing to merge back. What I'm suggesting *is* splitting this up, so subsequent passes can take a stab at it. In this case, combine cleans it up. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32901