[OpenWrt-Devel] [PATCH] toolchain: gcc: Fix ath79 kernel boot

Hauke Mehrtens hauke at hauke-m.de
Mon Apr 6 17:34:10 EDT 2020


This reverts a commit from GCC which causes boot problems with ath79
boards with MIPS 74Kc CPUs.
The kernel crashed like this:
[    0.097796] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.107070] Kernel panic - not syncing: Unexpected DSP exception
[    0.113470] Rebooting in 1 seconds..

The following GCC ticket was opened:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94506

Fixes: FS#2928
Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 ...e-optimization-91355-optimized-code-.patch | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 toolchain/gcc/patches/8.4.0/200-Revert-re-PR-tree-optimization-91355-optimized-code-.patch

diff --git a/toolchain/gcc/patches/8.4.0/200-Revert-re-PR-tree-optimization-91355-optimized-code-.patch b/toolchain/gcc/patches/8.4.0/200-Revert-re-PR-tree-optimization-91355-optimized-code-.patch
new file mode 100644
index 000000000000..0fbab6ebf569
--- /dev/null
+++ b/toolchain/gcc/patches/8.4.0/200-Revert-re-PR-tree-optimization-91355-optimized-code-.patch
@@ -0,0 +1,46 @@
+From e73998c880ed37d41a926ce9e2aa9c143eb7077a Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
+Date: Mon, 6 Apr 2020 21:15:31 +0200
+Subject: [PATCH] Revert "re PR tree-optimization/91355 (optimized code does
+ not call destructor while unwinding after exception)"
+
+This reverts commit 9fe0f3b6468871448bf40751a4f30cf20118ce6a.
+---
+ gcc/ChangeLog                          |  4 ----
+ gcc/testsuite/ChangeLog                |  3 ---
+ gcc/testsuite/g++.dg/torture/pr91355.C | 28 --------------------------
+ gcc/tree-ssa-sink.c                    |  2 +-
+ 4 files changed, 1 insertion(+), 36 deletions(-)
+ delete mode 100644 gcc/testsuite/g++.dg/torture/pr91355.C
+
+diff --git a/gcc/ChangeLog b/gcc/ChangeLog
+index 142499c563c..5b83f1b2370 100644
+--- a/gcc/ChangeLog
++++ b/gcc/ChangeLog
+@@ -644,10 +644,6 @@
+ 
+ 2019-11-21  Jakub Jelinek  <jakub at redhat.com>
+ 
+-	PR tree-optimization/91355
+-	* tree-ssa-sink.c (select_best_block): Use >= rather than >
+-	for early_bb scaled count with best_bb count comparison.
+-
+ 	Backported from mainline
+ 	2019-11-20  Jakub Jelinek  <jakub at redhat.com>
+ 
+diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c
+index 5ac18289d90..345ed2b0329 100644
+--- a/gcc/tree-ssa-sink.c
++++ b/gcc/tree-ssa-sink.c
+@@ -229,7 +229,7 @@ select_best_block (basic_block early_bb,
+       /* If result of comparsion is unknown, preffer EARLY_BB.
+ 	 Thus use !(...>=..) rather than (...<...)  */
+       && !(best_bb->count.apply_scale (100, 1)
+-	   >= early_bb->count.apply_scale (threshold, 1)))
++	   > (early_bb->count.apply_scale (threshold, 1))))
+     return best_bb;
+ 
+   /* No better block found, so return EARLY_BB, which happens to be the
+-- 
+2.20.1
+
-- 
2.20.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list