This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, rs6000] Don't mark the TOC reg as set up in prologue
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Pat Haugen <pthaugen at linux dot vnet dot ibm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, David Edelsohn <dje dot gcc at gmail dot com>
- Date: Thu, 14 Sep 2017 11:35:48 -0500
- Subject: Re: [PATCH, rs6000] Don't mark the TOC reg as set up in prologue
- Authentication-results: sourceware.org; auth=none
- References: <ec9d9abb-d8a6-8c12-97e0-46aec069790a@linux.vnet.ibm.com>
On Thu, Sep 14, 2017 at 10:18:55AM -0500, Pat Haugen wrote:
> --- gcc/config/rs6000/rs6000.c (revision 252029)
> +++ gcc/config/rs6000/rs6000.c (working copy)
> @@ -37807,6 +37807,11 @@ rs6000_set_up_by_prologue (struct hard_r
> add_to_hard_reg_set (&set->set, Pmode, RS6000_PIC_OFFSET_TABLE_REGNUM);
> if (cfun->machine->split_stack_argp_used)
> add_to_hard_reg_set (&set->set, Pmode, 12);
> +
> + /* Make sure the hard reg set doesn't include r2, which was possibly added
> + via PIC_OFFSET_TABLE_REGNUM. */
> + if (TARGET_TOC)
> + remove_from_hard_reg_set (&set->set, Pmode, TOC_REGNUM);
> }
Hrm, can't you simply not add it in the first place? Just a few lines up?
Segher