Hello, This is my proposed fix for PR53948. We don't want to put user variables in callee-clobbered registers, but obviously function arguments are OK there. REG_USERVAR_P is set on PARM_DECLs and on user variables, so it can't be used to distinguish between the two.
As it turns out, I can hi-jack a bit for that: 'unchanging' (currently incorrectly documented as used on REG) for a new macro REG_FUNCTION_PARM_P. I found one obvious place where this bit can be used instead of REG_USERVAR_P, and probably there are a few more places where this is useful (TBD, I'm going to look at all places where RTL code looks at tree's PARM_DECL later). Bootstrapped&tested on powerpc64-unknown-linux-gnu. OK for trunk? Ciao! Steven PR debug/53948 * rtl.h (REG_FUNCTION_PARM_P): New flag on a REG. Re-use 'unchaning'. * emit-rtl.c (mark_function_parm_reg): New function. * function.c (assign_parm_setup_reg): Use mark_function_parm_reg instead of mark_user_reg. * combine.c (can_change_dest_mode): Preserve REG_FUNCTION_PARM_P. * web.c (entry_register): Likewise. * reload1.c (reload): Likewise. * ira-emit.c (ira_create_new_reg): Likewise. * reginfo.c (reg_scan_mark_refs): Likewise. * optabs.c (emit_libcall_block_1): Use REG_FUNCTION_PARM_P instead of REG_USERVAR_P. * regstat.c (dump_reg_info): Print REG_FUNCTION_PARM_P. * doc/rtl.texi (REG_FUNCTION_PARM_P): Document it. ('unchanging' flag): Fix documentation.
PR53948.diff
Description: Binary data