http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47521
--- Comment #6 from Jeffrey A. Law <law at redhat dot com> 2011-02-03 14:32:03 UTC --- -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 02/03/11 07:16, tony.poppleton at gmail dot com wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47521 > > --- Comment #5 from Tony Poppleton <tony.poppleton at gmail dot com> > 2011-02-03 14:16:01 UTC --- > As a quick test, would this be fixed by re-ordering the register file to move > eax above edx? It's like flipping a coin. Sometimes its heads, sometimes its tails, tailoring the compiler around the fact that for this code we got tails isn't an approach we generally take. There is no sound reason to change the ordering of the registers. > > If so, then another possible fix to this would be to effectively re-run the RA > pass multiple times, each time using a different register file, and then > select > the one that produces the "best" code and discard the other RA attempts. I don't think we're likely to take this approach. As I mentioned earlier, using %edx is a complete and total red herring; ignore it. The real issue here is there's an unnecessary reg-reg copy. The unnecessary copy can be attributed to many factors (coalescing early, combine's inability to deal with hard regs well, reload's inability to handle hard regs well in certain circumstances, IRA not realizing the ranges of "a" can profitably be split, etc). Those are the avenues I would suggest someone wanting to fix this bug pursue. jeff -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJNSrxYAAoJEBRtltQi2kC7QKgH/05w+yEifZXhs+H/ueGrUk7f Z+H60AE8iGt10Z2w90bQEWAABLk8yeucZi/4g3tpwcqEwbmWn3FSyRYKlebdtPyn hTuq1ysIbjiN6lSfECvBUApSiATOJkHUi9izvriiOye5Zhn0LUKVBRtFWBLwnE0E MejL8vqkaMowCjC0+OJxuEyYNNBZj/YleOVwpjIH3kRxyWOv5p0UA2omah1bvDGs a4a7bCemRB04LByZL30JyXx/wpa8JHcEsLSlM0Him/JiRx6VNMj37uXVQVVn4CfX JP0CzZq9+7tzeaiT36cfdWKX9kPTRObPPVbAuYhkJc4jgoxsPxlxB6REh5Hkx34= =YmpV -----END PGP SIGNATURE-----