This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Committed: fix build error for cris-*-* due to rtx canonicalization change


On Tue, 2008-04-08 at 12:26 +0200, Eric Botcazou wrote:
> > I must say there are two things I don't like about 133985: that
> > (plus symbol_ref reg/f) can appear in the first place, and that
> > (plus reg/f symbol_ref) is *equal* in precedence to it.
> 
> I think it's only a fallout of Peter's change, i.e. the initial goal of the 
> change can be achieved without this.

Prompted by the failures caused by this hunk, I dug into why I made that
change in the first place.  Below is some text I added to PR28690,
so maybe I can achieve the same effect with a better patch.  Thoughts?

Peter


Ok, I dug into this a little deeper.  For the following test case:

  int array[1024];
  void
  clear_table (unsigned int n)
  {
    unsigned int i;
    for (i = 0; i < n; i++)
      array[i] = 0;
  }

compiling this with -O1 (it's ok with -O2 or above) on powerpc{,64}-linux,
during expand, we call swap_commutative_operands_p with a SYMBOL_REF and a REG
which currently prefers the REG first.  Later, break_out_memory_refs forces the
SYMBOL_REF into a register (with the REG_POINTER attribute set), but we're
already done swapping, so we get the wrong operand ordering.  Paolo, I wonder
if this patch instead of the rtlanal.c hunk might be better.  It does fix my
problem:

Index: explow.c
===================================================================
--- explow.c    (revision 134095)
+++ explow.c    (working copy)
@@ -305,7 +305,7 @@ break_out_memory_refs (rtx x)
       rtx op1 = break_out_memory_refs (XEXP (x, 1));

       if (op0 != XEXP (x, 0) || op1 != XEXP (x, 1))
-       x = gen_rtx_fmt_ee (GET_CODE (x), Pmode, op0, op1);
+       x = simplify_gen_binary (GET_CODE (x), Pmode, op0, op1);
     }

   return x;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]