Fix missing else keyword seen with clang-static-analyzer:
authorMartin Liska <mliska@suse.cz>
Wed, 26 Jun 2019 06:44:28 +0000 (08:44 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Wed, 26 Jun 2019 06:44:28 +0000 (06:44 +0000)
2019-06-26  Martin Liska  <mliska@suse.cz>

* 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

gcc/ChangeLog
gcc/bb-reorder.c

index 7945fdca7dafd1572a981fcd2625b13848ef63fb..fbaed7f466a51a727a69f93a80db6191dbab7342 100644 (file)
@@ -1,3 +1,15 @@
+2019-06-26  Martin Liska  <mliska@suse.cz>
+
+       * 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  <hongtao.liu@intel.com>
            H.J. Lu  <hongjiu.lu@intel.com>
            Olga Makhotina  <olga.makhotina@intel.com>
index c21d204627e5205da09e60b17d909a7386ab9e3f..0ac39140c6ce3db8499f99cd8f483218888de61b 100644 (file)
@@ -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)