1. code below compiles into many instructions like "movl $0, 16(%eax)", should have been "stosw" since all initializations are zeros. Even if one or two are skipped in the middle still bulk stosw should be used. 2. Even when class E with external constructor uncommented this shouldn't change since constructor can't change any data in C. Yuri ----code---- class E { // int j; public: E(); }; class C { int h, i, j, k, l; // E e; int m, n, o, p, q, r, s, t, u, v; public: C(); }; C::C() : h(0), i(0), j(), k(0), l(0), m(0), n(0), o(0), p(0), q(0), r(0), s(0), t(0), u(0), v(0) { }
Confirmed, note this is either a front-end bug because the front-end produces multiple stores or a target bug for not combining those stores to one store string instruction. Also if one initializer is missing it turns out it is undefined if you access that data.
actually I want to generalize it: any situation in C++/C/Ada when many enough close (in memory) variables are assigned the same value should use bulk "stos(b/w/l)". This should be applied as part of optimization.
*** This bug has been marked as a duplicate of 23684 ***
*** Bug 53254 has been marked as a duplicate of this bug. ***