On Thursday 12 January 2006 10:47, [EMAIL PROTECTED] wrote: > But... it used to be the case that the compiler didn't try to warn about > uninitialized variables embedded in structs (or so I seem to > remember...) So I was wondering if this was some kind of regression... > Progression, of sorts. Your structure is being scalarized, and as it happens, the compiler is probably using best.d as a loop induction variable (try -fdump-tree-all and see the .c.t*.optimized dump).
> Of course, initializing best.d is an easy way out, but it's sub-optimal > and useless. > Sub-optimal? > The "struct {unsigned int score; unsigned int d;} best = best;" trick > seems to work fine and has no influence on the generated code. > Neither will the explicit initialization, which I find more readable. But it's your code, so *shrug*.