Denis Chertykov schrieb: > Georg-Johann Lay : >> Weddington, Eric schrieb: >>>> This is yet another attempt to fix PR46278 (fake X addressing). >>>> >>>> After the previous clean-ups it is just a small change. >>>> >>>> caller-saves.c tries to eliminate call-clobbered hard-regs allocated to >>>> pseudos around function calls and that leads to situations that reload is >>>> no more capable to perform all requested spills because of the very few >>>> AVR's address registers. >>>> >>>> Thus, the patch adds a new target option -mstrict-X so that the user can >>>> turn that option if he like to do so, and then -fcaller-save is disabled. >>>> >>>> The patch passes the testsuite without regressions. Moreover, the >>>> testsuite passes without regressions if all test cases are run with >>>> -mstrict-X and all libraries (libgcc, avr-libc) are built with the new >>>> option turned on. >>> Hi Johann, >>> >>> Sorry, I haven't been keeping up with the discussion on this PR. >>> >>> But if all test cases pass with running -mstrict-X and everything built with >>> that option on, then why is this even an option? Is it because that it may >>> not always reduce code size?... >> An alternative would be to set -mstrict-X per default if -O or higher. >> Let's see what Denis thinks. > > I think that it's just a great results. > I vote for committing this patch.
So I will proceed and commit this patch if there are no objections or propositions to improve it. > About "to set -mstrict-X per default": if it's possible to print > something like "Please use -mno-strict-X" instead of "Spill error > failure...." then we can use -mstrict-X by default. I don't see a way to hook in spill_failure or find_reload_regs or have backend target specific customization of diagnostics. Except someone experienced in that field recommends, say, hooking into diagnostic printer somehow. If so, I'd prefer to do that in a separate patch. > i.e. how user can get a knowledge about a correlation between "Spill > error..." and -mstrict-X ...or between "spill error" and -fcaller-saves... Johann > Denis.