diff options
author | 2013-02-25 03:49:18 +0000 | |
---|---|---|
committer | 2013-02-25 03:49:18 +0000 | |
commit | 33dd3c9b2d65c27317db7b9c68494a0d86676887 (patch) | |
tree | 6fea7321a0002f7f4c8a4ee9580587d8c9b712c4 /4.7.2 | |
parent | Patch for bug #417271. (diff) | |
download | gcc-patches-33dd3c9b2d65c27317db7b9c68494a0d86676887.tar.gz gcc-patches-33dd3c9b2d65c27317db7b9c68494a0d86676887.tar.bz2 gcc-patches-33dd3c9b2d65c27317db7b9c68494a0d86676887.zip |
Add patch for PR55940.
Diffstat (limited to '4.7.2')
-rw-r--r-- | 4.7.2/gentoo/95_all_pr55940_4.7.3_x86-stack-parameters.patch | 93 | ||||
-rw-r--r-- | 4.7.2/gentoo/README.history | 3 |
2 files changed, 95 insertions, 1 deletions
diff --git a/4.7.2/gentoo/95_all_pr55940_4.7.3_x86-stack-parameters.patch b/4.7.2/gentoo/95_all_pr55940_4.7.3_x86-stack-parameters.patch new file mode 100644 index 0000000..6117bc7 --- /dev/null +++ b/4.7.2/gentoo/95_all_pr55940_4.7.3_x86-stack-parameters.patch @@ -0,0 +1,93 @@ +Incorrect code for accessing parameters with 32-bit Intel hosts +http://gcc.gnu.org/PR55940 + + +commit eccae624ce764c52ff7ffbc3db95fc58c01ab5d4 +Author: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> +Date: Fri Feb 1 14:09:38 2013 +0000 + + Backported from mainline + 2013-01-15 Jakub Jelinek <jakub@redhat.com> + + PR target/55940 + * function.c (thread_prologue_and_epilogue_insns): Always + add crtl->drap_reg to set_up_by_prologue.set, even if + stack_realign_drap is false. + + * gcc.dg/pr55940.c: New test. + + + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@195656 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + gcc/function.c | 2 +- + gcc/testsuite/gcc.dg/pr55940.c | 54 ++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 67 insertions(+), 1 deletion(-) + +--- a/gcc/function.c ++++ b/gcc/function.c +@@ -5961,7 +5961,7 @@ thread_prologue_and_epilogue_insns (void) + if (pic_offset_table_rtx) + add_to_hard_reg_set (&set_up_by_prologue.set, Pmode, + PIC_OFFSET_TABLE_REGNUM); +- if (stack_realign_drap && crtl->drap_reg) ++ if (crtl->drap_reg) + add_to_hard_reg_set (&set_up_by_prologue.set, + GET_MODE (crtl->drap_reg), + REGNO (crtl->drap_reg)); +--- /dev/null ++++ b/gcc/testsuite/gcc.dg/pr55940.c +@@ -0,0 +1,54 @@ ++/* PR target/55940 */ ++/* { dg-do run } */ ++/* { dg-options "-Os" } */ ++/* { dg-additional-options "-mpreferred-stack-boundary=2" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ ++ ++struct S { int s; unsigned long t; }; ++ ++__attribute__ ((noinline, noclone)) unsigned long long ++bar (struct S *x, unsigned long y) ++{ ++ asm volatile ("" : : "r" (x), "r" (y) : "memory"); ++ return x->s + y; ++} ++ ++__attribute__ ((noinline, noclone)) unsigned long long ++foo (struct S *x, unsigned long y) ++{ ++ unsigned long a; ++ if (__builtin_expect (((__UINTPTR_TYPE__) (x) + 0x1000U < 0x2000U), 0)) ++ return ~0ULL; ++ if (__builtin_expect (x->s <= 0 || x->s > 9, 0)) ++ return ~0ULL; ++ a = x->t >> 12; ++ if (y == a) ++ return ~0ULL; ++ if (x->s == 3) ++ return x->t + y * 4096; ++ return bar (x, y); ++} ++ ++int va, vb, vc, vd; ++ ++int ++main () ++{ ++ struct S s; ++ asm volatile ("" : : : "memory"); ++ int a = va, b = vb, c = vc, d = vd; ++ asm volatile ("" : : : "memory"); ++ int i; ++ for (i = 0; i < 64; i++) ++ if (foo ((struct S *) 0, 0) != ~0ULL) ++ __builtin_abort (); ++ s.s = 3; ++ s.t = 2 << 12; ++ if (foo (&s, 2) != ~0ULL) ++ __builtin_abort (); ++ if (foo (&s, 3) != (2 << 12) + 3 * 4096) ++ __builtin_abort (); ++ asm volatile ("" : : : "memory"); ++ va = a; vb = b; vc = c; vd = d; ++ asm volatile ("" : : : "memory"); ++ return 0; ++} diff --git a/4.7.2/gentoo/README.history b/4.7.2/gentoo/README.history index 553dd72..901079a 100644 --- a/4.7.2/gentoo/README.history +++ b/4.7.2/gentoo/README.history @@ -1,9 +1,10 @@ -1.4 [pending] +1.4 24 Jan 2013 - 03_all_java-nomulti.patch + 48_all_x86_pr53113_libitm-avx.patch - 49_all_gcc-4.7-x86-libitm-pr52695.patch + 49_all_x86_pr52695_libitm-m64.patch + 82_all_alpha_4.6.4_pr56023_bootstrap.patch + + 95_all_pr55940_4.7.3_x86-stack-parameters.patch 1.3 04 Nov 2012 + 93_all_pr33763_4.7.3_extern-inline.patch |