https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65503

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-03-26
                 CC|                            |jason at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Mikhail Maltsev from comment #2)
> Also, I noticed that in some cases GCC is able to generate a loop for
> initialization:
> 
> #include <string>
> 
> int main() {
>     std::string m[1000] {"x", "y"};
>     std::string n[1000] = {"x", "y"};
> }
> 
> That is done in cp/init.c:build_vec_init. But for the original testcase, the
> loop is not created. Is it a bug?

It's a poor optimization choice; we ought to build a loop for member array
initialization as well as array variables.

Reply via email to