From: Martin Liska Date: Wed, 26 Jun 2019 06:44:28 +0000 (+0200) Subject: Fix missing else keyword seen with clang-static-analyzer: X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=02e18a0e8a922af6a09ef58922ac44bacd4eb5c6;p=gcc.git Fix missing else keyword seen with clang-static-analyzer: 2019-06-26 Martin Liska * bb-reorder.c (connect_better_edge_p): Add missing else statement in the middle of if-else statements. /home/marxin/Programming/gcc/gcc/bb-reorder.c:1031:2: warning: Value stored to 'is_better_edge' is never read is_better_edge = true; ^ ~~~~ /home/marxin/Programming/gcc/gcc/bb-reorder.c:1034:2: warning: Value stored to 'is_better_edge' is never read is_better_edge = false; ^ ~~~~~ From-SVN: r272670 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7945fdca7da..fbaed7f466a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2019-06-26 Martin Liska + + * bb-reorder.c (connect_better_edge_p): Add missing else + statement in the middle of if-else statements. + +/home/marxin/Programming/gcc/gcc/bb-reorder.c:1031:2: warning: Value stored to 'is_better_edge' is never read + is_better_edge = true; + ^ ~~~~ +/home/marxin/Programming/gcc/gcc/bb-reorder.c:1034:2: warning: Value stored to 'is_better_edge' is never read + is_better_edge = false; + ^ ~~~~~ + 2019-06-25 Hongtao Liu H.J. Lu Olga Makhotina diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index c21d204627e..0ac39140c6c 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -1032,7 +1032,7 @@ connect_better_edge_p (const_edge e, bool src_index_p, int best_len, else if (e->count () < cur_best_edge->count ()) /* The edge has lower probability than the temporary best edge. */ is_better_edge = false; - if (e->probability > cur_best_edge->probability) + else if (e->probability > cur_best_edge->probability) /* The edge has higher probability than the temporary best edge. */ is_better_edge = true; else if (e->probability < cur_best_edge->probability)