Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | From 7cc702c7b5a1ccc2b0091f3effa1391b6c3030fd Mon Sep 17 00:00:00 2001 |
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> |
| 3 | Date: Wed, 16 Aug 2017 10:46:28 +0800 |
| 4 | Subject: [PATCH 3/4] tests/bench-slope.c: workaround ICE failure on mips with |
| 5 | '-O -g' |
| 6 | |
| 7 | Hit a ICE and could reduce it to the following minimal example: |
| 8 | |
| 9 | 1. Only the size of array assigned with 2 caused the issue: |
| 10 | $ cat > mipgcc-test.c << END |
| 11 | |
| 12 | int 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 | |
| 26 | END |
| 27 | |
| 28 | 2. Only -O1 and -g on mips caused the issue: |
| 29 | $ mips-poky-linux-gcc -O1 -g -o mipgcc-test mipgcc-test.c |
| 30 | mipgcc-test.c: In function 'main': |
| 31 | mipgcc-test.c:18:1: internal compiler error: in dwarf2out_var_location, |
| 32 | at dwarf2out.c:20810 |
| 33 | } |
| 34 | ^ |
| 35 | Please submit a full bug report, |
| 36 | with preprocessed source if appropriate. |
| 37 | See <http://gcc.gnu.org/bugs.html> for instructions |
| 38 | |
| 39 | 3. The quick workround is trying to enlarge the size of array with |
| 40 | larger |
| 41 | than 2. |
| 42 | |
| 43 | 4. File a bug to GNU, but it could not be reproduced on there |
| 44 | environment. |
| 45 | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60643 |
| 46 | |
| 47 | Upstream-Status: Inappropriate [oe specific] |
| 48 | |
| 49 | Rebase to 1.8.0 |
| 50 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
| 51 | --- |
| 52 | tests/bench-slope.c | 4 ++-- |
| 53 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 54 | |
| 55 | diff --git a/tests/bench-slope.c b/tests/bench-slope.c |
| 56 | index 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 | -- |
| 78 | 1.8.3.1 |
| 79 | |