1From 7cc702c7b5a1ccc2b0091f3effa1391b6c3030fd Mon Sep 17 00:00:00 2001 2From: Hongxu Jia <hongxu.jia@windriver.com> 3Date: Wed, 16 Aug 2017 10:46:28 +0800 4Subject: [PATCH 3/4] tests/bench-slope.c: workaround ICE failure on mips with 5 '-O -g' 6 7Hit a ICE and could reduce it to the following minimal example: 8 91. Only the size of array assigned with 2 caused the issue: 10$ cat > mipgcc-test.c << END 11 12int main (int argc, char **argv) 13{ 14 char *pStrArry[ARRAY_SIZE_MAX] = {"hello"}; 15 int i = 0; 16 17 while(pStrArry[i] && i<ARRAY_SIZE_MAX) 18 { 19 printf("%s\n", pStrArry[i]); 20 i++; 21 } 22 23 return 0; 24} 25 26END 27 282. Only -O1 and -g on mips caused the issue: 29$ mips-poky-linux-gcc -O1 -g -o mipgcc-test mipgcc-test.c 30mipgcc-test.c: In function 'main': 31mipgcc-test.c:18:1: internal compiler error: in dwarf2out_var_location, 32at dwarf2out.c:20810 33 } 34 ^ 35Please submit a full bug report, 36with preprocessed source if appropriate. 37See <http://gcc.gnu.org/bugs.html> for instructions 38 393. The quick workround is trying to enlarge the size of array with 40larger 41than 2. 42 434. File a bug to GNU, but it could not be reproduced on there 44environment. 45http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60643 46 47Upstream-Status: Inappropriate [oe specific] 48 49Rebase to 1.8.0 50Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> 51--- 52 tests/bench-slope.c | 4 ++-- 53 1 file changed, 2 insertions(+), 2 deletions(-) 54 55diff --git a/tests/bench-slope.c b/tests/bench-slope.c 56index 75e6e43..4e70842 100644 57--- a/tests/bench-slope.c 58+++ b/tests/bench-slope.c 59@@ -1463,7 +1463,7 @@ static struct bench_ops hash_ops = { 60 }; 61 62 63-static struct bench_hash_mode hash_modes[] = { 64+static struct bench_hash_mode hash_modes[3] = { 65 {"", &hash_ops}, 66 {0}, 67 }; 68@@ -1629,7 +1629,7 @@ static struct bench_ops mac_ops = { 69 }; 70 71 72-static struct bench_mac_mode mac_modes[] = { 73+static struct bench_mac_mode mac_modes[3] = { 74 {"", &mac_ops}, 75 {0}, 76 }; 77-- 781.8.3.1 79 80