Hi,

Following our discussions about changing the frame direction on
aarch64, I have written a small test case using a large frame which
shows similar code generation with and without my patch. There
are small differences in register allocation which lead to larger
prologue/epilogue with my patch, but I think this could (should) be
improved independently.
I have attached the sample C source and the code generated with
(frane64.s.O2) and without (frame64.s.O2.ref) my patch when compiling
at -O2.

What do you think?

Thanks,

Christophe.

On 28 June 2013 13:41, Christophe Lyon <christophe.l...@linaro.org> wrote:
> Hi,
> Following the discussion on
> http://gcc.gnu.org/ml/gcc/2013-05/msg00208.html
> here is a patch to change the frame direction.
>
> Passed 'make check' with no regression on aarch64-none-linux-gnu and
> with a few UNSUPPORTED -> PASS on aarch64-none-elf (pr34225, pr38616,
> pr38902, pr40971, pr46440, pr47766, pr49307, all of which are guarded
> by dg-require-effective-target fstack_protector).
>
> OK for trunk?
>
> Thanks,
>
> Christophe.
> 2013-06-28  Christophe Lyon  <christophe.l...@linaro.org>
>
> * config/aarch64/aarch64.h (FRAME_GROWS_DOWNWARD): Define to 1.
> * config/aarch64/aarch64.c (aarch64_initial_elimination_offset):
> Add get_frame_size () when eliminating frame pointer.
#define SIZE1 100000

extern int func2(int);

int func1(int arg1, int arg2)
{
  int var1;
  int array1[SIZE1];
  int var2 = 0;

  for (var1 = arg1; var1 < arg2; var1++) {
    array1[var1] = func2(var1);
  }

  for (var1 = arg1; var1 < arg2; var1++) {
    var2 += array1[var1];
  }

  var2 += (array1[arg1] + array1[arg2-1]) / 2;

  return var2;
}

Attachment: frame64.s.O2
Description: Binary data

Attachment: frame64.s.O2.ref
Description: Binary data

Reply via email to