------- Comment #2 from jakub at gcc dot gnu dot org 2008-09-09 17:50 ------- The problem here is that gimplify_init_constructor calls can_move_by_pieces, and the default MOVE_BY_PIECES_P uses optimize_insn_for_speed_p: #define MOVE_BY_PIECES_P(SIZE, ALIGN) \ (move_by_pieces_ninsns (SIZE, ALIGN, MOVE_MAX_PIECES + 1) \ < (unsigned int) MOVE_RATIO (optimize_insn_for_speed_p ()))
But during gimplification *crtl is cleared, so eventhough optimize_function_for_speed_p (cfun) is true, crtl->maybe_hot_insn_p is false. Should gimplify_init_constructor temporarily set crtl->maybe_hot_insn_p = true? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37338