c-warn.c (warn_logical_operator): Return early if -Wlogical-op is not in effect.
authorMarek Polacek <polacek@redhat.com>
Mon, 18 Dec 2017 16:49:59 +0000 (16:49 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Mon, 18 Dec 2017 16:49:59 +0000 (16:49 +0000)
* c-warn.c (warn_logical_operator): Return early if -Wlogical-op is
not in effect.

From-SVN: r255782

gcc/c-family/ChangeLog
gcc/c-family/c-warn.c

index dd71fd01fe025893f4b823a5c0dc903714b785ea..820e66aee0e39ca201b5decedbfe0d534d990873 100644 (file)
@@ -1,3 +1,8 @@
+2017-12-18  Marek Polacek  <polacek@redhat.com>
+
+       * c-warn.c (warn_logical_operator): Return early if -Wlogical-op is
+       not in effect.
+
 2017-12-17  Martin Sebor  <msebor@redhat.com>
 
        * c-attribs.c (common_handle_aligned_attribute): Avoid issuing
index 6045d6e17a97f508b3b9b1d769a39949852cc0b0..4246ce3bb3e59421762eaabd6bb163fb31565ced 100644 (file)
@@ -180,6 +180,9 @@ warn_logical_operator (location_t location, enum tree_code code, tree type,
   tree low0, low1, low, high0, high1, high, lhs, rhs, tem;
   bool strict_overflow_p = false;
 
+  if (!warn_logical_op)
+    return;
+
   if (code != TRUTH_ANDIF_EXPR
       && code != TRUTH_AND_EXPR
       && code != TRUTH_ORIF_EXPR