On Feb 7, 2013, at 3:49 AM, Richard Biener <richard.guent...@gmail.com> wrote: > On Thu, Feb 7, 2013 at 11:51 AM, Alan Modra <amo...@gmail.com> wrote: >> On Thu, Feb 07, 2013 at 10:11:02AM +0100, Richard Biener wrote: >>> On Thu, Feb 7, 2013 at 9:45 AM, Alan Modra <amo...@gmail.com> wrote: >>>> I think this one counts as obvious, but I'll ask for permission anyway. >>>> Bootstrapped etc. powerpc-linux. OK everywhere? >>> >>> Isn't there a way to just disable the out-of-line register save/restore >>> functions? Adding -O2 looks odd. >> >> There isn't. See rs6000.c:rs6000_savres_strategy. I should note too >> that using -O2 (anything but -Os) is only a solution for powerpc ELF. >> powerpc-darwin may not be susceptible to the bug, but if it is then >> some changes will be needed in rs6000_savres_strategy. AIX doesn't >> have a problem here since it always uses inline gpr saves/restores. >> >> Also, powerpc64 targets using GNU ld or gold don't have a problem with >> crtend.o calling save/restore functions as the linker creates these >> functions. > > It should be possible to add a -msavres-inline switch, right? The other > option would be to have a -Ono-s option that turns -Os into -O2 > (optimize == 2 for both) but leaves -O1/-O0 alone (by basically just > setting optimize_size to 0). Of course I consider that more ugly than > a new switch to explicitely disable non-inline saveres code ;)
I like the -O2 approach as a permanent solution… Having flags adds a burden to everyone and should be discouraged in all but the most dire of cases. This isn't dire enough.