public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "iains at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/105426] [wrong-code][regression][coroutines] range-for temporaries are not persisted in coroutines
Date: Thu, 28 Apr 2022 18:55:15 +0000	[thread overview]
Message-ID: <bug-105426-4-xLub16H3LJ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105426-4@http.gcc.gnu.org/bugzilla/>

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |iains at gcc dot gnu.org
   Last reconfirmed|                            |2022-04-28
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #2 from Iain Sandoe <iains at gcc dot gnu.org> ---
So the fix for PR105287 was too ambitious - and reveals that we are missing to
name some variables that should be promoted.

Rather than delay for a second fix, the proposal would be a partial reversion
of r12-8308-g15a176a833f23e, like so (which would be more suitable for the
branch).  This does fix the new issue (and still fixes the analyser one) in my
local testing.


diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
index 551ddc9cc41..2e393b2cddc 100644
--- a/gcc/cp/coroutines.cc
+++ b/gcc/cp/coroutines.cc
@@ -3973,6 +3973,9 @@ register_local_var_uses (tree *stmt, int *do_subtree,
void *d)
          else if (lvname != NULL_TREE)
            buf = xasprintf ("%s_%u_%u", IDENTIFIER_POINTER (lvname),
                             lvd->nest_depth, lvd->bind_indx);
+         else
+           buf = xasprintf ("_D%u_%u_%u", DECL_UID (lvar), lvd->nest_depth,
+                            lvd->bind_indx);
          /* TODO: Figure out if we should build a local type that has any
             excess alignment or size from the original decl.  */
          if (buf)

  parent reply	other threads:[~2022-04-28 18:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-28 15:56 [Bug c++/105426] New: " avi at scylladb dot com
2022-04-28 15:56 ` [Bug c++/105426] " avi at scylladb dot com
2022-04-28 18:55 ` iains at gcc dot gnu.org [this message]
2022-04-29  6:36 ` rguenth at gcc dot gnu.org
2022-04-29  6:36 ` cvs-commit at gcc dot gnu.org
2022-04-29  6:37 ` [Bug c++/105426] [12/13 Regression] " rguenth at gcc dot gnu.org
2022-04-29  6:40 ` iains at gcc dot gnu.org
2022-04-29  8:29 ` cvs-commit at gcc dot gnu.org
2022-04-29  8:30 ` iains 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-105426-4-xLub16H3LJ@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).