diff options
| author | Chen Qi <Qi.Chen@windriver.com> | 2017-10-27 17:43:51 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-11-08 22:24:04 +0000 |
| commit | b656fd9267b1f36d46ca20a1c0bcfaedbf7df438 (patch) | |
| tree | 5ba18dc576d40584fdab6dfb3de18f2c2c2bbef5 | |
| parent | af34166d38382382df5b6400fa30ac80b209a866 (diff) | |
| download | poky-b656fd9267b1f36d46ca20a1c0bcfaedbf7df438.tar.gz | |
gcc: fix miscompilation on mips64
We've observed strange behaviour of `systemctl status <xxx> on qemumips64.
The output of the command is like `systemctl show <xxx>', which is incorrect.
This patch is from gcc bugzilla's attachment.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81803
The patch hasn't been merged into gcc. But it does solve the above problem.
(From OE-Core rev: 3717c76eb24217c14a22f72fdd8732923729dee8)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-devtools/gcc/gcc-7.2.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/gcc/gcc-7.2/fix-miscompilation-for-O1-on-mips64el.patch | 35 |
2 files changed, 36 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-7.2.inc b/meta/recipes-devtools/gcc/gcc-7.2.inc index 5883bc61a6..04edad77cb 100644 --- a/meta/recipes-devtools/gcc/gcc-7.2.inc +++ b/meta/recipes-devtools/gcc/gcc-7.2.inc | |||
| @@ -75,6 +75,7 @@ SRC_URI = "\ | |||
| 75 | file://0048-gcc-Enable-static-PIE.patch \ | 75 | file://0048-gcc-Enable-static-PIE.patch \ |
| 76 | file://fix-segmentation-fault-precompiled-hdr.patch \ | 76 | file://fix-segmentation-fault-precompiled-hdr.patch \ |
| 77 | file://0050-RISC-V-Handle-non-legitimate-address-in-riscv_legiti.patch \ | 77 | file://0050-RISC-V-Handle-non-legitimate-address-in-riscv_legiti.patch \ |
| 78 | file://fix-miscompilation-for-O1-on-mips64el.patch \ | ||
| 78 | ${BACKPORTS} \ | 79 | ${BACKPORTS} \ |
| 79 | " | 80 | " |
| 80 | BACKPORTS = "\ | 81 | BACKPORTS = "\ |
diff --git a/meta/recipes-devtools/gcc/gcc-7.2/fix-miscompilation-for-O1-on-mips64el.patch b/meta/recipes-devtools/gcc/gcc-7.2/fix-miscompilation-for-O1-on-mips64el.patch new file mode 100644 index 0000000000..28020b0e3b --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-7.2/fix-miscompilation-for-O1-on-mips64el.patch | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | This patch comes from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81803 | ||
| 2 | |||
| 3 | Author: mpf <mpf@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
| 4 | |||
| 5 | This patch hasn't been merged into gcc. But it does solve the problem of | ||
| 6 | strange behaviour of `systemd status <xxx>' on qemumips64. | ||
| 7 | |||
| 8 | Upstream-Status: Pending [Taken from gcc bugzilla's attachment] | ||
| 9 | |||
| 10 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> | ||
| 11 | --- | ||
| 12 | gcc/lra-constraints.c | 7 ++++++- | ||
| 13 | 1 file changed, 6 insertions(+), 1 deletion(-) | ||
| 14 | |||
| 15 | diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c | ||
| 16 | index c8bc9b9a66f..6d319662b09 100644 | ||
| 17 | --- a/gcc/lra-constraints.c | ||
| 18 | +++ b/gcc/lra-constraints.c | ||
| 19 | @@ -4235,7 +4235,12 @@ curr_insn_transform (bool check_only_p) | ||
| 20 | && (goal_alt[i] == NO_REGS | ||
| 21 | || (simplify_subreg_regno | ||
| 22 | (ira_class_hard_regs[goal_alt[i]][0], | ||
| 23 | - GET_MODE (reg), byte, mode) >= 0))))) | ||
| 24 | + GET_MODE (reg), byte, mode) >= 0)))) | ||
| 25 | + || (type != OP_IN | ||
| 26 | + && GET_MODE_PRECISION (mode) | ||
| 27 | + < GET_MODE_PRECISION (GET_MODE (reg)) | ||
| 28 | + && GET_MODE_SIZE (GET_MODE (reg)) <= UNITS_PER_WORD | ||
| 29 | + && WORD_REGISTER_OPERATIONS)) | ||
| 30 | { | ||
| 31 | /* An OP_INOUT is required when reloading a subreg of a | ||
| 32 | mode wider than a word to ensure that data beyond the | ||
| 33 | -- | ||
| 34 | 2.13.0 | ||
| 35 | |||
