The functionality is explained in a comment in the patch. So I do not repeat that here.
This problem is exposed after a patch that I recently committed to generate +0.0 using xor, instead of loading it from constant area. Currently this is a targetted fix for this particular pattern. I tried a little to create other testcases with a similar problem, but that was not successful. If you have ideas for generalizing the patch, I can update it.
Actually, go ahead and put this in the commit message as well. That way there's an easier record of it there too. More detailed commit messages are often goodness.