public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/108457] [13 Regression] tree-ssa-loop-niter.cc:2255:23: warning: variable 'mode' set but not used
Date: Wed, 18 Jan 2023 21:07:12 +0000	[thread overview]
Message-ID: <bug-108457-4-Bi1p1kzgJs@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108457-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108457

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|tree-ssa-loop-niter.cc:2255 |[13 Regression]
                   |:23: warning: variable      |tree-ssa-loop-niter.cc:2255
                   |'mode' set but not used     |:23: warning: variable
                   |                            |'mode' set but not used
          Component|bootstrap                   |tree-optimization
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |build
   Target Milestone|---                         |13.0
   Last reconfirmed|                            |2023-01-18

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Basically C[TL]Z_DEFINED_VALUE_AT_ZERO macro does not always use its arguments
so they don't get marked as used ...

Simple patch:

diff --git a/gcc/tree-ssa-loop-niter.cc b/gcc/tree-ssa-loop-niter.cc
index 65b960461ae..22e7c0f6ea5 100644
--- a/gcc/tree-ssa-loop-niter.cc
+++ b/gcc/tree-ssa-loop-niter.cc
@@ -2253,6 +2253,8 @@ build_cltz_expr (tree src, bool leading, bool
define_at_zero)
                                           integer_type_node, 1, src);
       int val;
       scalar_int_mode mode = SCALAR_INT_TYPE_MODE (utype);
+      /* mode might not be used by the macro C[TL]Z_DEFINED_AT_ZERO. */
+      (void)mode;
       int optab_defined_at_zero
        = leading ? CLZ_DEFINED_VALUE_AT_ZERO (mode, val)
                  : CTZ_DEFINED_VALUE_AT_ZERO (mode, val);

  reply	other threads:[~2023-01-18 21:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18 20:57 [Bug bootstrap/108457] New: " danglin at gcc dot gnu.org
2023-01-18 21:07 ` pinskia at gcc dot gnu.org [this message]
2023-01-18 21:19 ` [Bug tree-optimization/108457] [13 Regression] " dave.anglin at bell dot net
2023-01-19 12:06 ` jakub at gcc dot gnu.org
2023-01-19 12:23 ` jakub at gcc dot gnu.org
2023-01-19 14:16 ` pinskia at gcc dot gnu.org
2023-01-20  9:24 ` cvs-commit at gcc dot gnu.org
2023-01-20  9:29 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-108457-4-Bi1p1kzgJs@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).