[Bug c++/57788] Waste work in maybe_deduce_size_from_array_init
pchang9 at cs dot wisc.edu
gcc-bugzilla@gcc.gnu.org
Tue Jul 2 19:21:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57788
--- Comment #1 from Po-Chun Chang <pchang9 at cs dot wisc.edu> ---
(In reply to Po-Chun Chang from comment #0)
> Created attachment 30427 [details]
> 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.
Actual errors are reported as diagnostic inside the function
check_array_designated_initializer(), so the loop can't break prematurely.
More information about the Gcc-bugs
mailing list