summaryrefslogtreecommitdiff
path: root/patches/gcc/4.9.4
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2016-11-18 01:20:48 (GMT)
committerAlexey Neyman <stilor@att.net>2016-11-18 01:20:48 (GMT)
commit1517360c6af78a6cb9fc419fa0aa1a304ec88aff (patch)
tree1011d044e5f01ab3ff21422f16d9a80d89ff670e /patches/gcc/4.9.4
parent18b5382e9c535f7f530fdd3abbe33ef18629a042 (diff)
Add missing 4.9.3 patches.
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'patches/gcc/4.9.4')
-rw-r--r--patches/gcc/4.9.4/001-gcc_bug_62231.patch129
-rw-r--r--patches/gcc/4.9.4/002-gcc_bug_62231.patch18
-rw-r--r--patches/gcc/4.9.4/131-mt-ospace-preserve-FLAGS_FOR_TARGET.patch28
3 files changed, 175 insertions, 0 deletions
diff --git a/patches/gcc/4.9.4/001-gcc_bug_62231.patch b/patches/gcc/4.9.4/001-gcc_bug_62231.patch
new file mode 100644
index 0000000..e7c9cf9
--- /dev/null
+++ b/patches/gcc/4.9.4/001-gcc_bug_62231.patch
@@ -0,0 +1,129 @@
+As-applied. From:
+
+https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02625.html
+
+Linked from bug62231 comment 4 there
+
+diff -durN a/gcc/defaults.h b/gcc/defaults.h
+--- a/gcc/defaults.h 2013-01-10 12:38:27.000000000 -0800
++++ b/gcc/defaults.h 2014-12-15 13:26:13.498904465 -0800
+@@ -438,6 +438,11 @@
+ #define DWARF_FRAME_REGNUM(REG) DBX_REGISTER_NUMBER (REG)
+ #endif
+
++/* The mapping from dwarf CFA reg number to internal dwarf reg numbers. */
++#ifndef DWARF_REG_TO_UNWIND_COLUMN
++#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
++#endif
++
+ /* Map register numbers held in the call frame info that gcc has
+ collected using DWARF_FRAME_REGNUM to those that should be output in
+ .debug_frame and .eh_frame. */
+diff -durN a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c
+--- a/gcc/dwarf2cfi.c 2013-01-10 12:38:27.000000000 -0800
++++ b/gcc/dwarf2cfi.c 2014-12-15 13:50:24.554883694 -0800
+@@ -225,7 +225,44 @@
+ emit_move_insn (adjust_address (mem, mode, offset), GEN_INT (size));
+ }
+
+-/* Generate code to initialize the register size table. */
++/* Helper for expand_builtin_init_dwarf_reg_sizes. Generate code to
++ initialize the dwarf register size table entry corresponding to register
++ REGNO in REGMODE. TABLE is the table base address, SLOTMODE is the mode
++ to use for the size entry to initialize, and WROTE_RETURN_COLUMN needs to
++ be set to true if the dwarf register number for REGNO is the dwarf return
++ column number. */
++
++static
++void init_one_dwarf_reg_size (int regno, enum machine_mode regmode,
++ rtx table, enum machine_mode slotmode,
++ bool *wrote_return_column)
++{
++ const unsigned int dnum = DWARF_FRAME_REGNUM (regno);
++ const unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
++ const unsigned int dcol = DWARF_REG_TO_UNWIND_COLUMN (rnum);
++
++ const HOST_WIDE_INT slotoffset = dcol * GET_MODE_SIZE (slotmode);
++ const HOST_WIDE_INT regsize = GET_MODE_SIZE (regmode);
++
++ if (rnum >= DWARF_FRAME_REGISTERS)
++ return;
++
++ if (dnum == DWARF_FRAME_RETURN_COLUMN)
++ {
++ if (regmode == VOIDmode)
++ return;
++ *wrote_return_column = true;
++ }
++
++ if (slotoffset < 0)
++ return;
++
++ emit_move_insn (adjust_address (table, slotmode, slotoffset),
++ gen_int_mode (regsize, slotmode));
++}
++
++/* Generate code to initialize the dwarf register size table located
++ at the provided ADDRESS. */
+
+ void
+ expand_builtin_init_dwarf_reg_sizes (tree address)
+@@ -238,30 +275,21 @@
+
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
+- unsigned int dnum = DWARF_FRAME_REGNUM (i);
+- unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
+-
+- if (rnum < DWARF_FRAME_REGISTERS)
+- {
+- HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode);
+- enum machine_mode save_mode = reg_raw_mode[i];
+- HOST_WIDE_INT size;
+-
+- if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
+- save_mode = choose_hard_reg_mode (i, 1, true);
+- if (dnum == DWARF_FRAME_RETURN_COLUMN)
+- {
+- if (save_mode == VOIDmode)
+- continue;
+- wrote_return_column = true;
+- }
+- size = GET_MODE_SIZE (save_mode);
+- if (offset < 0)
+- continue;
++ enum machine_mode save_mode = reg_raw_mode[i];
++ rtx span;
+
+- emit_move_insn (adjust_address (mem, mode, offset),
+- gen_int_mode (size, mode));
+- }
++ span = targetm.dwarf_register_span (gen_rtx_REG (save_mode, i));
++ if (!span)
++ init_one_dwarf_reg_size (i, save_mode, mem, mode, &wrote_return_column);
++ else
++ {
++ for (int si = 0; si < XVECLEN (span, 0); si++)
++ {
++ rtx reg = XVECEXP (span, 0, si);
++ init_one_dwarf_reg_size
++ (REGNO (reg), GET_MODE (reg), mem, mode, &wrote_return_column);
++ }
++ }
+ }
+
+ if (!wrote_return_column)
+diff -durN a/libgcc/unwind-dw2.c b/libgcc/unwind-dw2.c
+--- a/libgcc/unwind-dw2.c 2013-05-31 16:21:46.000000000 -0700
++++ b/libgcc/unwind-dw2.c 2014-12-15 13:26:13.570904866 -0800
+@@ -55,10 +55,6 @@
+ #define PRE_GCC3_DWARF_FRAME_REGISTERS DWARF_FRAME_REGISTERS
+ #endif
+
+-#ifndef DWARF_REG_TO_UNWIND_COLUMN
+-#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
+-#endif
+-
+ /* ??? For the public function interfaces, we tend to gcc_assert that the
+ column numbers are in range. For the dwarf2 unwind info this does happen,
+ although so far in a case that doesn't actually matter.
diff --git a/patches/gcc/4.9.4/002-gcc_bug_62231.patch b/patches/gcc/4.9.4/002-gcc_bug_62231.patch
new file mode 100644
index 0000000..b970ebc
--- /dev/null
+++ b/patches/gcc/4.9.4/002-gcc_bug_62231.patch
@@ -0,0 +1,18 @@
+As-applied. From:
+
+https://gcc.gnu.org/ml/gcc-patches/2014-10/msg02605.html
+
+Linked from bug62231 comment 4 there
+
+diff -durN a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
+--- a/gcc/config/rs6000/rs6000.c 2014-12-08 17:29:04.000000000 -0800
++++ b/gcc/config/rs6000/rs6000.c 2014-12-15 14:44:46.568801843 -0800
+@@ -1673,7 +1673,7 @@
+ SCmode so as to pass the value correctly in a pair of
+ registers. */
+ else if (TARGET_E500_DOUBLE && FLOAT_MODE_P (mode) && mode != SCmode
+- && !DECIMAL_FLOAT_MODE_P (mode))
++ && !DECIMAL_FLOAT_MODE_P (mode) && SPE_SIMD_REGNO_P (regno))
+ reg_size = UNITS_PER_FP_WORD;
+
+ else
diff --git a/patches/gcc/4.9.4/131-mt-ospace-preserve-FLAGS_FOR_TARGET.patch b/patches/gcc/4.9.4/131-mt-ospace-preserve-FLAGS_FOR_TARGET.patch
new file mode 100644
index 0000000..1c49fb0
--- /dev/null
+++ b/patches/gcc/4.9.4/131-mt-ospace-preserve-FLAGS_FOR_TARGET.patch
@@ -0,0 +1,28 @@
+From 9bcf38cd9f382486b3823eb923b50e2e9a89cef7 Mon Sep 17 00:00:00 2001
+From: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 18 Nov 2014 22:12:52 +0000
+Subject: [PATCH] 2014-11-17 Bob Dunlop <bob.dunlop@xyzzy.org.uk>
+
+ * mt-ospace (CFLAGS_FOR_TARGET): Append -g -Os rather than
+ overwriting.
+ (CXXFLAGS_FOR_TARGET): Similarly.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217739 138bc75d-0d04-0410-961f-82ee72b054a4
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ config/mt-ospace | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/config/mt-ospace b/config/mt-ospace
+index 7f09104..ce29ff4 100644
+--- a/config/mt-ospace
++++ b/config/mt-ospace
+@@ -1,3 +1,3 @@
+ # Build libraries optimizing for space, not speed.
+- CFLAGS_FOR_TARGET = -g -Os
+- CXXFLAGS_FOR_TARGET = -g -Os
++ CFLAGS_FOR_TARGET += -g -Os
++ CXXFLAGS_FOR_TARGET += -g -Os
+--
+2.1.4
+