From: vmakarov Date: Mon, 22 Apr 2013 14:26:51 +0000 (+0000) Subject: 2013-04-22 Vladimir Makarov X-Git-Tag: upstream/4.9.2~6521 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fbb45ff16ad0870e6ba4243da2aa6317103dae8e;p=platform%2Fupstream%2Flinaro-gcc.git 2013-04-22 Vladimir Makarov PR target/57018 * lra-eliminations.c (mark_not_eliminable): Prevent elimination of a set sp if no stack realignment. 2013-04-22 Vladimir Makarov PR target/57018 * gcc.target/i386/pr57018.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198140 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 358ced1..3e930b4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-04-22 Vladimir Makarov + + PR target/57018 + * lra-eliminations.c (mark_not_eliminable): Prevent elimination of + a set sp if no stack realignment. + 2013-04-22 Nick Clifton * config.gcc (tilegx-linux): Extend extra_objs rather than diff --git a/gcc/lra-eliminations.c b/gcc/lra-eliminations.c index b8ec69f..27a5d75 100644 --- a/gcc/lra-eliminations.c +++ b/gcc/lra-eliminations.c @@ -716,7 +716,9 @@ mark_not_eliminable (rtx x) ep++) if (ep->to_rtx == SET_DEST (x) && SET_DEST (x) != hard_frame_pointer_rtx - && (GET_CODE (SET_SRC (x)) != PLUS + && (! (SUPPORTS_STACK_ALIGNMENT && stack_realign_fp + && REGNO (ep->to_rtx) == STACK_POINTER_REGNUM) + || GET_CODE (SET_SRC (x)) != PLUS || XEXP (SET_SRC (x), 0) != SET_DEST (x) || ! CONST_INT_P (XEXP (SET_SRC (x), 1)))) setup_can_eliminate (ep, false); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0938ce4..3917bbe 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-04-22 Vladimir Makarov + + PR target/57018 + * gcc.target/i386/pr57018.c: New test. + 2013-04-22 James Greenhalgh * gcc.target/aarch64/vrecps.c: New. diff --git a/gcc/testsuite/gcc.target/i386/pr57018.c b/gcc/testsuite/gcc.target/i386/pr57018.c new file mode 100644 index 0000000..fb0d849 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr57018.c @@ -0,0 +1,31 @@ +/* { dg-do run } */ +/* { dg-options "-Os -fomit-frame-pointer -fno-asynchronous-unwind-tables" } */ +/* { dg-additional-options "-march=i686" { target ia32 } } */ + +struct A { char a[16]; } a; + +void __attribute__((noinline, noclone)) +foo (struct A b) +{ + if (__builtin_memcmp (b.a, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16)) + __builtin_abort (); + asm volatile ("" : : : "memory"); +} + +void __attribute__((noinline, noclone)) +bar (struct A b) +{ + foo (a); + a = b; +} + +int +main () +{ + struct A b = { "\0\1\2\3\4\5\6\7\10\11\12\13\14\15\16\17" }; + bar (b); + if (__builtin_memcmp (a.a, b.a, 16)) + __builtin_abort (); + return 0; +} +