diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2018-09-13 00:20:12 +0100 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2018-09-13 00:20:12 +0100 |
commit | 7bd9679989239cba83bb0c632bd2f0909b03d1b8 (patch) | |
tree | 3f9d814f3e078b97bf2cb2d4f4b9cba79b420d77 /7.3.0 | |
parent | 2.95.3: cut new 1.5 patchset (diff) | |
download | gcc-patches-7bd9679989239cba83bb0c632bd2f0909b03d1b8.tar.gz gcc-patches-7bd9679989239cba83bb0c632bd2f0909b03d1b8.tar.bz2 gcc-patches-7bd9679989239cba83bb0c632bd2f0909b03d1b8.zip |
6/7/8 branches: add 101_all_x32-fix-eh-return-address.patch
Pick upstream fix for x32 exception handler: """
x86: Always update EH return address in word_mode
On x86, return address is always popped in word_mode. eh_return needs
to put EH return address in word_mode on stack.
"""
Reported-by: camper
Bug: https://bugs.gentoo.org/664016
Bug: https://gcc.gnu.org/PR87014
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to '7.3.0')
-rw-r--r-- | 7.3.0/gentoo/99_all_x32-fix-eh-return-address.patch | 37 | ||||
-rw-r--r-- | 7.3.0/gentoo/README.history | 1 |
2 files changed, 38 insertions, 0 deletions
diff --git a/7.3.0/gentoo/99_all_x32-fix-eh-return-address.patch b/7.3.0/gentoo/99_all_x32-fix-eh-return-address.patch new file mode 100644 index 0000000..c74a087 --- /dev/null +++ b/7.3.0/gentoo/99_all_x32-fix-eh-return-address.patch @@ -0,0 +1,37 @@ +Bug: https://bugs.gentoo.org/664016 + +From 2a8e2ab2e9e11b679616d80285296ac77ad0920f Mon Sep 17 00:00:00 2001 +From: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> +Date: Mon, 20 Aug 2018 19:14:04 +0000 +Subject: [PATCH] x86: Always update EH return address in word_mode + +On x86, return address is always popped in word_mode. eh_return needs +to put EH return address in word_mode on stack. + +gcc/ + + PR target/87014 + * config/i386/i386.md (eh_return): Always update EH return + address in word_mode. + +gcc/testsuite/ + + PR target/87014 + * g++.dg/torture/pr87014.C: New file. + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263672 138bc75d-0d04-0410-961f-82ee72b054a4 +--- a/gcc/config/i386/i386.md ++++ b/gcc/config/i386/i386.md +@@ -13612,7 +13612,10 @@ + stack address we wish to restore. */ + tmp = gen_rtx_PLUS (Pmode, arg_pointer_rtx, sa); + tmp = plus_constant (Pmode, tmp, -UNITS_PER_WORD); +- tmp = gen_rtx_MEM (Pmode, tmp); ++ /* Return address is always in word_mode. */ ++ tmp = gen_rtx_MEM (word_mode, tmp); ++ if (GET_MODE (ra) != word_mode) ++ ra = convert_to_mode (word_mode, ra, 1); + emit_move_insn (tmp, ra); + + emit_jump_insn (gen_eh_return_internal ()); diff --git a/7.3.0/gentoo/README.history b/7.3.0/gentoo/README.history index 9eb4c76..7070e8f 100644 --- a/7.3.0/gentoo/README.history +++ b/7.3.0/gentoo/README.history @@ -1,5 +1,6 @@ 1.6 TODO + 98_all_msp430-partial-int.patch + + 99_all_x32-fix-eh-return-address.patch 1.6 18 Aug 2018 + 97_all_isl-include.patch 1.5 17 Aug 2018 |