Dear all,

I am currently working on defining the cost of an address calculation
and I have an issue when the function is inlined. It seems that when
the address cost is taken into account only sometimes.

Here is the test code that I am testing this on:

long tab[2];

void foo(long x) {
   long i;

   for (i = 0; i < 2; i++) {
      tab[i] = x;
   }

   return;
}

long main() {
   int i;
   for (i = 0; i < 10; i++) {
      foo(i);
   }
   return 0;
}


I get for the function foo :
    la  r6,tab
    std r8,8(r6)
    std r8,0(r6)

and for main:
    std r7,tab
    std r7,tab+8

I want the version of foo because the store with an address as
destination is costly on my architecture, which is why I defined
TARGET_ADDRESS_COST and added a cost when I get this scenario.
However, in the compilation of this code, it seems that, when the
function is inlined, the address_cost function does not seem to be
called anymore. Any ideas why ?

Thanks in advance,
Jean Christophe Beyler

Reply via email to