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++/58487] Missed return value optimization Date: Fri, 09 Jun 2023 15:42:03 +0000 [thread overview] Message-ID: <bug-58487-4-QXCDpMwRCr@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-58487-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58487 --- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Jason Merrill <jason@gcc.gnu.org>: https://gcc.gnu.org/g:953bbeaeff050f4d0b670568a587aa1ce82ed711 commit r14-1660-g953bbeaeff050f4d0b670568a587aa1ce82ed711 Author: Jason Merrill <jason@redhat.com> Date: Fri Jun 9 10:37:35 2023 -0400 c++: fix 32-bit spaceship failures [PR110185] Various spaceship tests failed after r14-1624. This turned out to be because the comparison category classes return in memory on 32-bit targets, and the synthesized operator<=> looks something like if (auto v = a.x <=> b.x, v == 0); else return v; if (auto v = a.y <=> b.y, v == 0); else return v; etc. so check_return_expr was trying to do NRVO for all the 'v' variables, and now on subsequent returns we check to see if the previous NRV is still in scope. But the NRVs didn't have names, so looking up name bindings crashed. Fixed both by giving 'v' a name so we can NRVO the first one, and fixing the test to give up if the old NRV has no name. PR c++/110185 PR c++/58487 gcc/cp/ChangeLog: * method.cc (build_comparison_op): Give retval a name. * typeck.cc (check_return_expr): Fix for nameless variables.
next prev parent reply other threads:[~2023-06-09 15:42 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-09-20 19:38 [Bug c++/58487] New: " jm at bourguet dot org 2021-06-28 16:36 ` [Bug c++/58487] " antoshkka at gmail dot com 2021-11-19 20:37 ` gcc_bugzilla at axeitado dot com 2023-06-06 16:11 ` jason at gcc dot gnu.org 2023-06-07 1:33 ` cvs-commit at gcc dot gnu.org 2023-06-07 22:08 ` cvs-commit at gcc dot gnu.org 2023-06-09 15:42 ` cvs-commit at gcc dot gnu.org [this message] 2023-12-19 20:45 ` jason 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-58487-4-QXCDpMwRCr@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: linkBe 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).