Re: [PATCH 8/4] match-trees: drop x = x initializations

2013-03-25 Thread Junio C Hamano
René Scharfe rene.scha...@lsrfire.ath.cx writes: Am 24.03.2013 05:55, schrieb Junio C Hamano: So I like your change for readability, but for GCC 4.4.5 we still need the unnecessary initialization. Hrm, perhaps we can make it even simpler for the compiler. And the result is even simpler for

Re: [PATCH 8/4] match-trees: drop x = x initializations

2013-03-24 Thread Jeff King
On Sat, Mar 23, 2013 at 09:55:53PM -0700, Junio C Hamano wrote: René Scharfe rene.scha...@lsrfire.ath.cx writes: Hmm, let's see if we can help the compiler follow the code without making it harder for people to understand. The patch looks a bit jumbled, but the resulting code is OK in

Re: [PATCH 8/4] match-trees: drop x = x initializations

2013-03-24 Thread René Scharfe
Am 24.03.2013 05:55, schrieb Junio C Hamano: However, the same compiler still thinks {elem,path,mode}1 can be used uninitialized (but not {elem,path,mode}2). The craziness I reported in the previous message is also the same. With this patch on top to swap the side we inspect first, the

Re: [PATCH 8/4] match-trees: drop x = x initializations

2013-03-23 Thread René Scharfe
Am 22.03.2013 17:21, schrieb Jeff King: Of the 8 patches, this is the one I find the least satisfying, if only because I do not think gcc's failure is because of complicated control flow, and rearranging the code would only hurt readability. Hmm, let's see if we can help the compiler follow

Re: [PATCH 8/4] match-trees: drop x = x initializations

2013-03-23 Thread Junio C Hamano
René Scharfe rene.scha...@lsrfire.ath.cx writes: Hmm, let's see if we can help the compiler follow the code without making it harder for people to understand. The patch looks a bit jumbled, but the resulting code is OK in my biased opinion. I actually think the result is much better than a

[PATCH 8/4] match-trees: drop x = x initializations

2013-03-22 Thread Jeff King
These nonsense assignments are meant to squelch gcc warnings that the variables might be used uninitialized. However, gcc gets it mostly right, realizing that we will either extract tree entries from both sides, or we will hit a continue statement and go to the top of the loop. However, while

Re: [PATCH 8/4] match-trees: drop x = x initializations

2013-03-22 Thread Junio C Hamano
Jeff King p...@peff.net writes: Of the 8 patches, this is the one I find the least satisfying, if only because I do not think gcc's failure is because of complicated control flow, and rearranging the code would only hurt readability. And I'm quite curious why it complains about mode, but not