https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87949
Bug ID: 87949
Summary: PowerPC saves CR registers across calls
Product: gcc
Version: 9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: meissner at gcc dot gnu.org
Target Milestone: ---
While there are 3 saved CR registers (CR2, CR3, CR4) in the PowerPC, we really,
really, really should not be saving CR values across calls due to the amount of
time it takes to save and restore these registers.
This shows up in the Spec 2006 perlbench benchmark where the hot function
(S_regmatch in regexep.c) saves all 3 CRs at the function prologue, and has to
restore these registers at the epilog.
It also shows up in the gamess benchmark (which is where I found it in doing
some future code). Note only do functions in gamess save all 3 CR registers,
at least one function decides to use caller saves to save a 4th CR register
across a call.
I'm not sure whether this is a target feature or a machine independent feature
at this point. My first attempt at fixing it via HARD_REGNO_CALLER_SAVE_MODE
fails due to LRA not supporting it returning VOIDmode (PR 87948).