I wrote a small function on Windows 10 as below picture. However, @code_native emits %r8d instead of %edx after prolog as in picture. It happens in 0.4.2 and latest 0.5-dev nightly build from julialang website. I cannot reproduce it with trivial functions *,+ etc. It may need an if else block to reproduce it with less code.
<https://lh3.googleusercontent.com/-F8wdsGzCwfM/VnFV3QrD2dI/AAAAAAAAF7k/NnpjValEFc8/s1600/registerbug.png>