From 040a55d0b730bf78aad0f51e0018faa88655e279 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 27 Jun 2013 08:38:37 -0700 Subject: gcc-4.8: Fix ICE on ppc/spe targets Rename patches to make them easly to apply with git Signed-off-by: Khem Raj Signed-off-by: Saul Wold --- meta/recipes-devtools/gcc/gcc-4.8.inc | 5 +- .../gcc/gcc-4.8/0037-gcc-4.8-PR56797.patch | 66 ++++++++++++++++++++++ .../gcc/gcc-4.8/0038-gcc-4.8-build-args.patch | 41 ++++++++++++++ .../gcc/gcc-4.8/0039-gcc-4.8-PR57717.patch | 23 ++++++++ .../gcc/gcc-4.8/gcc-4.8-PR56797.patch | 66 ---------------------- .../gcc/gcc-4.8/gcc-4.8-build-args.patch | 41 -------------- 6 files changed, 133 insertions(+), 109 deletions(-) create mode 100644 meta/recipes-devtools/gcc/gcc-4.8/0037-gcc-4.8-PR56797.patch create mode 100644 meta/recipes-devtools/gcc/gcc-4.8/0038-gcc-4.8-build-args.patch create mode 100644 meta/recipes-devtools/gcc/gcc-4.8/0039-gcc-4.8-PR57717.patch delete mode 100644 meta/recipes-devtools/gcc/gcc-4.8/gcc-4.8-PR56797.patch delete mode 100644 meta/recipes-devtools/gcc/gcc-4.8/gcc-4.8-build-args.patch (limited to 'meta/recipes-devtools/gcc') diff --git a/meta/recipes-devtools/gcc/gcc-4.8.inc b/meta/recipes-devtools/gcc/gcc-4.8.inc index bfdb766fef..3219e0c25b 100644 --- a/meta/recipes-devtools/gcc/gcc-4.8.inc +++ b/meta/recipes-devtools/gcc/gcc-4.8.inc @@ -66,8 +66,9 @@ SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \ file://0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch \ file://0035-wcast-qual-PR-55383.patch \ file://0036-PR-target-56102.patch \ - file://gcc-4.8-PR56797.patch \ - file://gcc-4.8-build-args.patch \ + file://0037-gcc-4.8-PR56797.patch \ + file://0038-gcc-4.8-build-args.patch \ + file://0039-gcc-4.8-PR57717.patch \ " SRC_URI[md5sum] = "3b2386c114cd74185aa3754b58a79304" SRC_URI[sha256sum] = "545b44be3ad9f2c4e90e6880f5c9d4f0a8f0e5f67e1ffb0d45da9fa01bb05813" diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0037-gcc-4.8-PR56797.patch b/meta/recipes-devtools/gcc/gcc-4.8/0037-gcc-4.8-PR56797.patch new file mode 100644 index 0000000000..b5d7b864fd --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.8/0037-gcc-4.8-PR56797.patch @@ -0,0 +1,66 @@ +Upstream-Status: Backport +Signed-off-by: Khem Raj + +From patchwork Fri Apr 19 09:34:49 2013 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [ARM] Fix PR56797 +Date: Thu, 18 Apr 2013 23:34:49 -0000 +From: Greta Yorsh +X-Patchwork-Id: 237891 +Message-Id: <000801ce3ce1$23fbdd60$6bf39820$@yorsh@arm.com> +To: "GCC Patches" +Cc: , "Richard Earnshaw" , + "Ramana Radhakrishnan" + +Fix PR56797 +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56797 + +The problem is that peephole optimizer thinks it can generate an ldm, but +the pattern for ldm no longer matches, because after r188738 it requires +that if one of the destination registers is SP then the base register must +be SP, and it's not SP in the test case. + +The test case fails on armv5t but doesn't fail on armv6t2 or armv7-a because +peephole doesn't trigger there (because there is a different epilogue +sequence). It looks like a latent problem for other architecture or CPUs. + +This patch adds this condition to the peephole optimizer. + +No regression on qemu for arm-none-eabi and fixes the test reported in the +PR. I couldn't minimize the test sufficiently to include it in the +testsuite. + +Ok for trunk? + +Thanks, +Greta + +gcc/ + +2013-04-18 Greta Yorsh + + PR target/56797 + * config/arm/arm.c (load_multiple_sequence): Require SP + as base register for loads if SP is in the register list. + + +diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c +index d00849c..60fef78 100644 +--- a/gcc/config/arm/arm.c ++++ b/gcc/config/arm/arm.c +@@ -10347,6 +10347,13 @@ load_multiple_sequence (rtx *operands, int nops, int *regs, int *saved_order, + || (i != nops - 1 && unsorted_regs[i] == base_reg)) + return 0; + ++ /* Don't allow SP to be loaded unless it is also the base ++ register. It guarantees that SP is reset correctly when ++ an LDM instruction is interruptted. Otherwise, we might ++ end up with a corrupt stack. */ ++ if (unsorted_regs[i] == SP_REGNUM && base_reg != SP_REGNUM) ++ return 0; ++ + unsorted_offsets[i] = INTVAL (offset); + if (i == 0 || unsorted_offsets[i] < unsorted_offsets[order[0]]) + order[0] = i; diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0038-gcc-4.8-build-args.patch b/meta/recipes-devtools/gcc/gcc-4.8/0038-gcc-4.8-build-args.patch new file mode 100644 index 0000000000..c27e009619 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.8/0038-gcc-4.8-build-args.patch @@ -0,0 +1,41 @@ +When cross compiling a target gcc, target flags may be used on the host + +Configure identifies a number of warning flags (WARN_CFLAGS and +WARN_CXXFLAGS) from the $CC value. The cross compiler may be different +from the host compiler and may not support the same set of flags. This +leads to problems such as: + +cc1plus: error: unrecognized command line option "-Wno-narrowing" +cc1plus: error: unrecognized command line option "-Wno-overlength-strings" + +Work around this problem by removing the warning flags from the +BUILD_CXXFLAGS value, in a way similar to the BUILD_CFLAGS. + +Upstream-Status: Pending + +Signed-off-by: Mark Hatle + +Index: gcc-4.8.0/gcc/configure +=================================================================== +--- gcc-4.8.0.orig/gcc/configure ++++ gcc-4.8.0/gcc/configure +@@ -11720,6 +10581,7 @@ STMP_FIXINC=stmp-fixinc + if test x$build != x$host || test "x$coverage_flags" != x + then + BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' ++ BUILD_CXXFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' + BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)' + fi + +Index: gcc-4.8.0/gcc/configure.ac +=================================================================== +--- gcc-4.8.0.orig/gcc/configure.ac ++++ gcc-4.8.0/gcc/configure.ac +@@ -1901,6 +1901,7 @@ STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_F + if test x$build != x$host || test "x$coverage_flags" != x + then + BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' ++ BUILD_CXXFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' + BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)' + fi + diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0039-gcc-4.8-PR57717.patch b/meta/recipes-devtools/gcc/gcc-4.8/0039-gcc-4.8-PR57717.patch new file mode 100644 index 0000000000..f983f70d02 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.8/0039-gcc-4.8-PR57717.patch @@ -0,0 +1,23 @@ +This backports fix from http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57717 + +Upstream-Status: Backport +Signed-off-by: Khem Raj + +Index: gcc-4.8.1/gcc/config/rs6000/rs6000.c +=================================================================== +--- gcc-4.8.1.orig/gcc/config/rs6000/rs6000.c 2013-05-09 18:54:06.000000000 -0700 ++++ gcc-4.8.1/gcc/config/rs6000/rs6000.c 2013-06-27 08:22:40.459021366 -0700 +@@ -5431,11 +5431,12 @@ + + case TFmode: + case TDmode: +- case TImode: + if (TARGET_E500_DOUBLE) + return (SPE_CONST_OFFSET_OK (offset) + && SPE_CONST_OFFSET_OK (offset + 8)); ++ /* Fall through. */ + ++ case TImode: + extra = 8; + if (!worst_case) + break; diff --git a/meta/recipes-devtools/gcc/gcc-4.8/gcc-4.8-PR56797.patch b/meta/recipes-devtools/gcc/gcc-4.8/gcc-4.8-PR56797.patch deleted file mode 100644 index b5d7b864fd..0000000000 --- a/meta/recipes-devtools/gcc/gcc-4.8/gcc-4.8-PR56797.patch +++ /dev/null @@ -1,66 +0,0 @@ -Upstream-Status: Backport -Signed-off-by: Khem Raj - -From patchwork Fri Apr 19 09:34:49 2013 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [ARM] Fix PR56797 -Date: Thu, 18 Apr 2013 23:34:49 -0000 -From: Greta Yorsh -X-Patchwork-Id: 237891 -Message-Id: <000801ce3ce1$23fbdd60$6bf39820$@yorsh@arm.com> -To: "GCC Patches" -Cc: , "Richard Earnshaw" , - "Ramana Radhakrishnan" - -Fix PR56797 -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56797 - -The problem is that peephole optimizer thinks it can generate an ldm, but -the pattern for ldm no longer matches, because after r188738 it requires -that if one of the destination registers is SP then the base register must -be SP, and it's not SP in the test case. - -The test case fails on armv5t but doesn't fail on armv6t2 or armv7-a because -peephole doesn't trigger there (because there is a different epilogue -sequence). It looks like a latent problem for other architecture or CPUs. - -This patch adds this condition to the peephole optimizer. - -No regression on qemu for arm-none-eabi and fixes the test reported in the -PR. I couldn't minimize the test sufficiently to include it in the -testsuite. - -Ok for trunk? - -Thanks, -Greta - -gcc/ - -2013-04-18 Greta Yorsh - - PR target/56797 - * config/arm/arm.c (load_multiple_sequence): Require SP - as base register for loads if SP is in the register list. - - -diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c -index d00849c..60fef78 100644 ---- a/gcc/config/arm/arm.c -+++ b/gcc/config/arm/arm.c -@@ -10347,6 +10347,13 @@ load_multiple_sequence (rtx *operands, int nops, int *regs, int *saved_order, - || (i != nops - 1 && unsorted_regs[i] == base_reg)) - return 0; - -+ /* Don't allow SP to be loaded unless it is also the base -+ register. It guarantees that SP is reset correctly when -+ an LDM instruction is interruptted. Otherwise, we might -+ end up with a corrupt stack. */ -+ if (unsorted_regs[i] == SP_REGNUM && base_reg != SP_REGNUM) -+ return 0; -+ - unsorted_offsets[i] = INTVAL (offset); - if (i == 0 || unsorted_offsets[i] < unsorted_offsets[order[0]]) - order[0] = i; diff --git a/meta/recipes-devtools/gcc/gcc-4.8/gcc-4.8-build-args.patch b/meta/recipes-devtools/gcc/gcc-4.8/gcc-4.8-build-args.patch deleted file mode 100644 index c27e009619..0000000000 --- a/meta/recipes-devtools/gcc/gcc-4.8/gcc-4.8-build-args.patch +++ /dev/null @@ -1,41 +0,0 @@ -When cross compiling a target gcc, target flags may be used on the host - -Configure identifies a number of warning flags (WARN_CFLAGS and -WARN_CXXFLAGS) from the $CC value. The cross compiler may be different -from the host compiler and may not support the same set of flags. This -leads to problems such as: - -cc1plus: error: unrecognized command line option "-Wno-narrowing" -cc1plus: error: unrecognized command line option "-Wno-overlength-strings" - -Work around this problem by removing the warning flags from the -BUILD_CXXFLAGS value, in a way similar to the BUILD_CFLAGS. - -Upstream-Status: Pending - -Signed-off-by: Mark Hatle - -Index: gcc-4.8.0/gcc/configure -=================================================================== ---- gcc-4.8.0.orig/gcc/configure -+++ gcc-4.8.0/gcc/configure -@@ -11720,6 +10581,7 @@ STMP_FIXINC=stmp-fixinc - if test x$build != x$host || test "x$coverage_flags" != x - then - BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' -+ BUILD_CXXFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' - BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)' - fi - -Index: gcc-4.8.0/gcc/configure.ac -=================================================================== ---- gcc-4.8.0.orig/gcc/configure.ac -+++ gcc-4.8.0/gcc/configure.ac -@@ -1901,6 +1901,7 @@ STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_F - if test x$build != x$host || test "x$coverage_flags" != x - then - BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' -+ BUILD_CXXFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' - BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)' - fi - -- cgit v1.2.3