This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix RTL sharing found during PPC bootstrap
- From: Roger Sayle <roger at eyesopen dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 16 Dec 2006 17:13:58 -0700 (MST)
- Subject: Re: Fix RTL sharing found during PPC bootstrap
Hi Jan,
On Sat, 16 Dec 2006, Jan Hubicka wrote:
> this patch brings PPC into bootstrapland with RTL sharing verifier.
> The first part is fixing expand_synth_mult that is called from
> unroll-loops and producing shared SUBREGS.
Instead of a calling copy_rtx on op0 repeatedly in expand_mult_const
how about generalizing the code:
/* Avoid referencing memory over and over.
For speed, but also for correctness when mem is volatile. */
if (MEM_P (op0))
op0 = force_reg (mode, op0);
and instead always call force_reg on op0. I disagree that RTL
expansion assumes that sharing is OK, rather I think the problem
is that RTL expansion often assumes that it's operands are pseudos.
This no only prevent the sharing issue, but may generate more
efficient code where by avoiding repeated evaluation of a general
operand.
I much prefer the alternate fix if it bootstraps and regression
tests without problems. And if you're planning on regularly
contributing to GCC, you should remember to include a ChangeLog
with your patch submissions :-)
Roger
--