On 10/2/18 12:51 PM, Peter Bergner wrote: > On 10/2/18 1:21 PM, Segher Boessenkool wrote: >> On Tue, Oct 02, 2018 at 11:42:19AM -0500, Peter Bergner wrote: >>> +/* The default implementation of >>> TARGET_SETJMP_PRESERVES_NONVOLATILE_REGS_P. */ >>> + >>> +bool >>> +default_setjmp_preserves_nonvolatile_regs_p (void) >>> +{ >>> + return false; >>> +} >> >> You can just use hook_bool_void_false for this (and hook_bool_void_true >> for e.g. the rs6000 implementation). > > Yes, much nicer and smaller patch using those functions! So here's version 3, > which is the same as version 2 but using above mentioned hook functions. > > This is currently bootstrapping right now, ok now assuming no regressions? > > Peter > > gcc/ > PR rtl-optimization/87466 > * target.def (setjmp_preserves_nonvolatile_regs_p): New target hook. > * doc/tm.texi.in (TARGET_SETJMP_PRESERVES_NONVOLATILE_REGS_P): New hook. > * doc/tm.texi: Regenerate. > * ira-lives.c (process_bb_node_lives): Use the new target hook. > * lra-lives.c (process_bb_lives): Likewise. > * config/rs6000/rs6000.c (TARGET_SETJMP_PRESERVES_NONVOLATILE_REGS_P): > Define. > > gcc/testsuite/ > PR rtl-optimization/87466 > * gcc.target/powerpc/pr87466.c: New test. Given the desire for reload to die and the difficulties testing this change on a reload target, I don't think mirroring this optimization in reload is necessary.
OK for the trunk. jeff