diff options
author | Martin Sebor <msebor@redhat.com> | 2020-06-08 09:06:48 -0600 |
---|---|---|
committer | Martin Sebor <msebor@redhat.com> | 2020-06-08 09:06:48 -0600 |
commit | c1057cc0a8ad972e0a2218ab74038a56e5514c39 (patch) | |
tree | 831d8a3c8c4568d1958cd5eb44e89fcd90689607 | |
parent | 5dc3986103d8908c802e940dea8f2def3a6989c2 (diff) | |
download | gcc-c1057cc0a8ad972e0a2218ab74038a56e5514c39.zip gcc-c1057cc0a8ad972e0a2218ab74038a56e5514c39.tar.gz gcc-c1057cc0a8ad972e0a2218ab74038a56e5514c39.tar.bz2 |
PR bootstrap/95555 - powepc64 bootstrap failure due to -Wmaybe-uninitialized in reload_cse_simplify_operands
gcc/ChangeLog:
* postreload.c (reload_cse_simplify_operands): Clear first array element
before using it. Assert a precondition.
-rw-r--r-- | gcc/postreload.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/postreload.c b/gcc/postreload.c index f625828..c9e6375 100644 --- a/gcc/postreload.c +++ b/gcc/postreload.c @@ -592,6 +592,13 @@ reload_cse_simplify_operands (rtx_insn *insn, rtx testreg) } } + /* The loop below sets alternative_order[0] but -Wmaybe-uninitialized + can't know that. Clear it here to avoid the warning. */ + alternative_order[0] = 0; + gcc_assert (!recog_data.n_alternatives + || (which_alternative >= 0 + && which_alternative < recog_data.n_alternatives)); + /* Record all alternatives which are better or equal to the currently matching one in the alternative_order array. */ for (i = j = 0; i < recog_data.n_alternatives; i++) |