public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/114691] [11 Regression] Bogus ignoring loop annotation warning
Date: Thu, 20 Jun 2024 13:23:15 +0000	[thread overview]
Message-ID: <bug-114691-4-VCMhFeh0M1@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114691-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:6ec50f5b9a8842f92d65dbd8fcc546f0f6902585

commit r11-11505-g6ec50f5b9a8842f92d65dbd8fcc546f0f6902585
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Apr 12 20:53:10 2024 +0200

    c++: Fix bogus warnings about ignored annotations [PR114691]

    The middle-end warns about the ANNOTATE_EXPR added for while/for loops
    if they declare a var inside of the loop condition.
    This is because the assumption is that ANNOTATE_EXPR argument is used
    immediately in a COND_EXPR (later GIMPLE_COND), but simplify_loop_decl_cond
    wraps the ANNOTATE_EXPR inside of a TRUTH_NOT_EXPR, so it no longer
    holds.

    The following patch fixes that by adding the TRUTH_NOT_EXPR inside of the
    ANNOTATE_EXPR argument if any.

    2024-04-12  Jakub Jelinek  <jakub@redhat.com>

            PR c++/114691
            * semantics.c (simplify_loop_decl_cond): Use cp_build_unary_op with
            TRUTH_NOT_EXPR on ANNOTATE_EXPR argument (if any) rather than
            ANNOTATE_EXPR itself.

            * g++.dg/ext/pr114691.C: New test.

    (cherry picked from commit 91146346f57cc54dfeb2669347edd0eb3d13af7f)

  parent reply	other threads:[~2024-06-20 13:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-11 10:08 [Bug c++/114691] New: [11/12/13/14 " jakub at gcc dot gnu.org
2024-04-11 10:09 ` [Bug c++/114691] " jakub at gcc dot gnu.org
2024-04-11 10:11 ` jakub at gcc dot gnu.org
2024-04-12 18:55 ` cvs-commit at gcc dot gnu.org
2024-04-12 18:55 ` [Bug c++/114691] [11/12/13 " jakub at gcc dot gnu.org
2024-04-21  4:09 ` cvs-commit at gcc dot gnu.org
2024-04-23  6:44 ` [Bug c++/114691] [11/12 " jakub at gcc dot gnu.org
2024-06-11 10:38 ` cvs-commit at gcc dot gnu.org
2024-06-11 10:53 ` [Bug c++/114691] [11 " jakub at gcc dot gnu.org
2024-06-20 13:23 ` cvs-commit at gcc dot gnu.org [this message]
2024-06-20 13:43 ` 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-114691-4-VCMhFeh0M1@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).