commit:     8f787f42d02e70eda8dd2dd98a56f2fa72c82894
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 15 19:29:50 2018 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sat Sep 15 19:29:50 2018 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=8f787f42

8.2.0: fix mmix, PR85666

Bug: https://gcc.gnu.org/PR85666
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 8.2.0/gentoo/103_all_mmix-fix-85666-p1.patch | 41 ++++++++++++++++++++++++++++
 8.2.0/gentoo/104_all_mmix-fix-85666-p2.patch | 30 ++++++++++++++++++++
 8.2.0/gentoo/README.history                  |  2 ++
 3 files changed, 73 insertions(+)

diff --git a/8.2.0/gentoo/103_all_mmix-fix-85666-p1.patch 
b/8.2.0/gentoo/103_all_mmix-fix-85666-p1.patch
new file mode 100644
index 0000000..ba74682
--- /dev/null
+++ b/8.2.0/gentoo/103_all_mmix-fix-85666-p1.patch
@@ -0,0 +1,41 @@
+From e66a5c025d0c3f4731a5f65ed2e6dbaf89bfaace Mon Sep 17 00:00:00 2001
+From: hp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Sun, 9 Sep 2018 18:05:48 +0000
+Subject: [PATCH]       PR target/85666         * config/mmix/mmix.c
+ (MMIX_CFUN_NEEDS_SAVED_EH_RETURN_ADDRESS): Don't      call leaf_function_p,
+ instead use has_hard_reg_initial_val.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264182 
138bc75d-0d04-0410-961f-82ee72b054a4
+--- a/gcc/config/mmix/mmix.c
++++ b/gcc/config/mmix/mmix.c
+@@ -60,19 +60,16 @@ along with GCC; see the file COPYING3.  If not see
+ 
+ /* We have no means to tell DWARF 2 about the register stack, so we need
+    to store the return address on the stack if an exception can get into
+-   this function.  FIXME: Narrow condition.  Before any whole-function
+-   analysis, df_regs_ever_live_p () isn't initialized.  We know it's 
up-to-date
+-   after reload_completed; it may contain incorrect information some time
+-   before that.  Within a RTL sequence (after a call to start_sequence,
+-   such as in RTL expanders), leaf_function_p doesn't see all insns
+-   (perhaps any insn).  But regs_ever_live is up-to-date when
+-   leaf_function_p () isn't, so we "or" them together to get accurate
+-   information.  FIXME: Some tweak to leaf_function_p might be
+-   preferable.  */
++   this function.  We'll have an "initial value" recorded for the
++   return-register if we've seen a call instruction emitted.  This note
++   will be inaccurate before instructions are emitted, but the only caller
++   at that time is looking for modulo from stack-boundary, to which the
++   return-address does not contribute, and which is always 0 for MMIX
++   anyway.  Beware of calling leaf_function_p here, as it'll abort if
++   called within a sequence.  */
+ #define MMIX_CFUN_NEEDS_SAVED_EH_RETURN_ADDRESS                       \
+  (flag_exceptions                                             \
+-  && ((reload_completed && df_regs_ever_live_p (MMIX_rJ_REGNUM))      \
+-      || !leaf_function_p ()))
++  && has_hard_reg_initial_val (Pmode, MMIX_INCOMING_RETURN_ADDRESS_REGNUM))
+ 
+ #define IS_MMIX_EH_RETURN_DATA_REG(REGNO)     \
+  (crtl->calls_eh_return               \
+-- 
+2.19.0
+

diff --git a/8.2.0/gentoo/104_all_mmix-fix-85666-p2.patch 
b/8.2.0/gentoo/104_all_mmix-fix-85666-p2.patch
new file mode 100644
index 0000000..2c0f056
--- /dev/null
+++ b/8.2.0/gentoo/104_all_mmix-fix-85666-p2.patch
@@ -0,0 +1,30 @@
+From 919e63e824a673c63575f753c861c330860e632a Mon Sep 17 00:00:00 2001
+From: hp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Sun, 9 Sep 2018 18:12:14 +0000
+Subject: [PATCH]       PR target/85666         * config/mmix/mmix.c
+ (mmix_assemble_integer): Handle byte-size     non-CONST_INT rtx:es using
+ assemble_integer_with_op ".byte".
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264183 
138bc75d-0d04-0410-961f-82ee72b054a4
+--- a/gcc/config/mmix/mmix.c
++++ b/gcc/config/mmix/mmix.c
+@@ -1370,8 +1370,14 @@ mmix_assemble_integer (rtx x, unsigned int size, int 
aligned_p)
+       case 1:
+       if (GET_CODE (x) != CONST_INT)
+         {
+-          aligned_p = 0;
+-          break;
++          /* There is no "unaligned byte" op or generic function to
++             which we can punt, so we have to handle this here.  As
++             the expression isn't a plain literal, the generated
++             assembly-code can't be mmixal-equivalent (i.e. "BYTE"
++             won't work) and thus it's ok to emit the default op
++             ".byte". */
++          assemble_integer_with_op ("\t.byte\t", x);
++          return true;
+         }
+       fputs ("\tBYTE\t", asm_out_file);
+       mmix_print_operand (asm_out_file, x, 'B');
+-- 
+2.19.0
+

diff --git a/8.2.0/gentoo/README.history b/8.2.0/gentoo/README.history
index b0c5ea5..7e89be2 100644
--- a/8.2.0/gentoo/README.history
+++ b/8.2.0/gentoo/README.history
@@ -1,6 +1,8 @@
 1.3            TODO
        + 101_all_x32-fix-eh-return-address.patch
        + 102_all_respect-build-cxxflags.patch
+       + 103_all_mmix-fix-85666-p1.patch
+       + 104_all_mmix-fix-85666-p2.patch
 1.2            12 Aug 2018
        - 100_all-isl-include.patch
        + 100_all_isl-include.patch

Reply via email to