https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62631

--- Comment #15 from amker at gcc dot gnu.org ---
(In reply to amker from comment #14)
> (In reply to Eric Botcazou from comment #12)
> > I'm about to install a patch that changes the costs on SPARC 64-bit to:
> > 
> > Use 1:
> >   cand  cost    compl.  depends on
> >   0     4       0        inv_expr:0
> >   1     8       0       
> >   4     6       0        inv_expr:1
> >   5     0       0       
> >   6     0       0
> > 
> > but this doesn't change the outcome of the test. :-(
> 
> I will have a look why it fails with refined cost.
> 
> Thanks,
> bin

The cost of expression "p + ((sizetype)(99 - i_6(D)) + 1) * 4"  computed using
normal +/-/* operators on sparc64 is 18, but the cost is 32 if it is computed
as "p + ((sizetype)(99 - i_6(D)) + 1) << 2", which is returned by
get_shiftadd_cost.

>From the assembly code, it seems the computation is expensive on sparc64, I may
skip the test for these architectures if no other solutions.

Thanks.

Reply via email to