Denis Chertykov wrote: > 2011/6/27 Georg-Johann Lay: >> Denis Chertykov wrote: >>> The main problem for me is that the new addressing mode produce a >>> worse code in many tests. >> You have an example source? > > In attachment. > > Denis. Hi Denis. I had a look at the sources you sent. sort.c: ======= There is some difference because of register allocation, but the new code does not look awfully bad, just a bit different because of different register allocation that might need some more bytes. The difference is *not* because of deny fake X addressing, it's because of the new avr_hard_regno_mode_ok implementation to fix PR46779. When I add if (GET_MODE_SIZE (mode) == 1) return 1; + if (SImode == mode && regno == 28) + return 0; return regno % 2 == 0; to that function, the difference in code disappears. pr.c: ===== I get the following sizes with pr-0 the original compile and pr qith my patch: >avr-size pr-0.o text data bss dec hex filename 2824 24 0 2848 b20 pr-0.o >avr-size pr.o text data bss dec hex filename 2564 24 0 2588 a1c pr.o So the size actually decreased significantly. Avoiding SI in avr_hard_regno_mode_ok like above does not change code size. ============ Note that I did *not* use the version from the git repository; I could not get reasonable code out of it (even after some fixes). Hundreds of testsuite crashes... I used the initial patch that I posted; I attached it again for reference. Note that LEGITIMIZE_RELOAD_ADDRESS is still not implemented there. ============ Did you decide about the fix for PR46779? http://gcc.gnu.org/ml/gcc-patches/2011-06/msg00810.html Is it ok to commit? I think fix PR46779 and fix fake X addresses (PR46278) should be separate patches and not intermixed. Johann