diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-10-02 21:23:01 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-10-02 21:23:01 +0000 |
commit | 5d96a478e4a66b44f76453865feece9d25975662 (patch) | |
tree | 39ea16fba9996ca92cfba7d3a1927eaaef917ede /5.2.0 | |
parent | fix building w/isl-0.15 #557330 (diff) | |
download | gcc-patches-5d96a478e4a66b44f76453865feece9d25975662.tar.gz gcc-patches-5d96a478e4a66b44f76453865feece9d25975662.tar.bz2 gcc-patches-5d96a478e4a66b44f76453865feece9d25975662.zip |
add upstream fix for miscompiles w/ms_abi attributes #549768 by Alexandre Rostovtsev
Diffstat (limited to '5.2.0')
-rw-r--r-- | 5.2.0/gentoo/69_all_gcc-5-ms_abi-pr66838.patch | 111 | ||||
-rw-r--r-- | 5.2.0/gentoo/README.history | 3 |
2 files changed, 114 insertions, 0 deletions
diff --git a/5.2.0/gentoo/69_all_gcc-5-ms_abi-pr66838.patch b/5.2.0/gentoo/69_all_gcc-5-ms_abi-pr66838.patch new file mode 100644 index 0000000..8a50328 --- /dev/null +++ b/5.2.0/gentoo/69_all_gcc-5-ms_abi-pr66838.patch @@ -0,0 +1,111 @@ +https://bugs.gentoo.org/549768 +https://gcc.gnu.org/PR66838 + +From 7dc80fc8bf531c5fe17a88fe505d1cd63867c190 Mon Sep 17 00:00:00 2001 +From: uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> +Date: Fri, 17 Jul 2015 13:50:38 +0000 +Subject: [PATCH] Backport from mainline: + +2015-07-15 Uros Bizjak <ubizjak@gmail.com> + + PR rtl-optimization/66838 + * postreload.c (reload_cse_move2add): Also process + CALL_INSN_FUNCTION_USAGE when resetting information of + call-clobbered registers. + +testsuite/ChangeLog: + + Backport from mainline: + 2015-07-15 Uros Bizjak <ubizjak@gmail.com> + + PR rtl-optimization/66838 + * gcc.target/i386/pr66838.c: New test. + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@225935 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + gcc/ChangeLog | 12 ++++++++++- + gcc/postreload.c | 17 ++++++++++++++++ + gcc/testsuite/ChangeLog | 8 ++++++++ + gcc/testsuite/gcc.target/i386/pr66838.c | 36 +++++++++++++++++++++++++++++++++ + 4 files changed, 72 insertions(+), 1 deletion(-) + create mode 100644 gcc/testsuite/gcc.target/i386/pr66838.c + +diff --git a/gcc/postreload.c b/gcc/postreload.c +index 3e2802d..58b586a 100644 +--- a/gcc/postreload.c ++++ b/gcc/postreload.c +@@ -2164,12 +2164,29 @@ reload_cse_move2add (rtx_insn *first) + unknown values. */ + if (CALL_P (insn)) + { ++ rtx link; ++ + for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; i--) + { + if (call_used_regs[i]) + /* Reset the information about this register. */ + reg_mode[i] = VOIDmode; + } ++ ++ for (link = CALL_INSN_FUNCTION_USAGE (insn); link; ++ link = XEXP (link, 1)) ++ { ++ rtx setuse = XEXP (link, 0); ++ rtx usage_rtx = XEXP (setuse, 0); ++ if (GET_CODE (setuse) == CLOBBER ++ && REG_P (usage_rtx)) ++ { ++ unsigned int end_regno = END_REGNO (usage_rtx); ++ for (unsigned int r = REGNO (usage_rtx); r < end_regno; ++r) ++ /* Reset the information about this register. */ ++ reg_mode[r] = VOIDmode; ++ } ++ } + } + } + return changed; +diff --git a/gcc/testsuite/gcc.target/i386/pr66838.c b/gcc/testsuite/gcc.target/i386/pr66838.c +new file mode 100644 +index 0000000..46effed +--- /dev/null ++++ b/gcc/testsuite/gcc.target/i386/pr66838.c +@@ -0,0 +1,36 @@ ++/* { dg-do run { target lp64 } } */ ++/* { dg-options "-O2" } */ ++ ++void abort (void); ++ ++char global; ++ ++__attribute__((sysv_abi, noinline, noclone)) ++void sysv_abi_func(char const *desc, void *local) ++{ ++ register int esi asm ("esi"); ++ register int edi asm ("edi"); ++ ++ if (local != &global) ++ abort (); ++ ++ /* Clobber some of the extra SYSV ABI registers. */ ++ asm volatile ("movl\t%2, %0\n\tmovl\t%2, %1" ++ : "=r" (esi), "=r" (edi) ++ : "i" (0xdeadbeef)); ++} ++ ++__attribute__((ms_abi, noinline, noclone)) ++void ms_abi_func () ++{ ++ sysv_abi_func ("1st call", &global); ++ sysv_abi_func ("2nd call", &global); ++ sysv_abi_func ("3rd call", &global); ++} ++ ++int ++main(void) ++{ ++ ms_abi_func(); ++ return 0; ++} +-- +2.5.2 + diff --git a/5.2.0/gentoo/README.history b/5.2.0/gentoo/README.history index d6e3714..2ba8eaf 100644 --- a/5.2.0/gentoo/README.history +++ b/5.2.0/gentoo/README.history @@ -1,3 +1,6 @@ +1.2 02 Oct 2015 + + 69_all_gcc-5-ms_abi-pr66838.patch + 1.1 25 Aug 2015 U 74_all_gcc5_isl-dl.patch |