http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57788
Bug ID: 57788 Summary: Waste work in maybe_deduce_size_from_array_init Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: pchang9 at cs dot wisc.edu CC: nistor1 at illinois dot edu Created attachment 30427 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30427&action=edit Suggested patch The problem appears in revision 200588 in version 4.9. I have attached a one-line patch that fixes it. In method "maybe_deduce_size_from_array_init()" in decl.c, the loop on line 4839 should break immediately after "failure" is set to 1. All the iterations after "failure" set to 1 do not perform any useful work, at best they just set "failure" again to 1.