From: H.J. Lu Date: Mon, 16 Feb 2009 20:37:49 +0000 (+0000) Subject: re PR target/37049 (Unaligned move used on aligned destination of push insn) X-Git-Tag: releases/gcc-4.4.0~532 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50aab7dc401b3b6cc0f74982231eb529ef06ebe1;p=thirdparty%2Fgcc.git re PR target/37049 (Unaligned move used on aligned destination of push insn) gcc/ 2009-02-16 H.J. Lu PR target/37049 * config/i386/i386.c (ix86_expand_push): Set memory alignment to function argument boundary. gcc/testsuite/ 2009-02-16 H.J. Lu PR target/37049 * gcc.target/i386/push-1.c: New. From-SVN: r144209 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a881d27fa49e..981f150f3b17 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-02-16 H.J. Lu + + PR target/37049 + * config/i386/i386.c (ix86_expand_push): Set memory alignment + to function argument boundary. + 2009-02-16 Hariharan Sandanagobalane * config/picochip/picochip.md (lea_add): Allow any nonimmediate diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 9c758a223eef..582a9dc4a697 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -12594,6 +12594,12 @@ ix86_expand_push (enum machine_mode mode, rtx x) emit_move_insn (stack_pointer_rtx, tmp); tmp = gen_rtx_MEM (mode, stack_pointer_rtx); + + /* When we push an operand onto stack, it has to be aligned at least + at the function argument boundary. */ + set_mem_align (tmp, + ix86_function_arg_boundary (mode, NULL_TREE)); + emit_move_insn (tmp, x); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f7d499cf2963..73f0bc58a6ed 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-02-16 H.J. Lu + + PR target/37049 + * gcc.target/i386/push-1.c: New. + 2009-02-15 Uros Bizjak * gcc.dg/struct/w_prof_single_str_global.c: Mask return value. diff --git a/gcc/testsuite/gcc.target/i386/push-1.c b/gcc/testsuite/gcc.target/i386/push-1.c new file mode 100644 index 000000000000..cf5a10413640 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/push-1.c @@ -0,0 +1,15 @@ +/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ +/* { dg-options "-w -msse2 -Os" } */ + +typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); + +extern void foo (__m128 x, __m128 y ,__m128 z ,__m128 a, int size); + +void +bar (void) +{ + __m128 x = { 1.0 }; + foo (x, x, x, x, 5); +} + +/* { dg-final { scan-assembler-not "movups" } } */