public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/102490] Erroneous optimization of default constexpr operator== of struct with bitfields
Date: Mon, 27 Sep 2021 10:16:13 +0000	[thread overview]
Message-ID: <bug-102490-4-0rTFRes5nR@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102490-4@http.gcc.gnu.org/bugzilla/>

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
                 CC|                            |jakub at gcc dot gnu.org
   Last reconfirmed|                            |2021-09-27
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Before r10-4397-gb7689b962dd6536bbb2567bfdec52e35109af7ab , this has been
rejected with:
pr102490.C:5:48: error: ‘constexpr bool A::operator==(const A&) const’ cannot
be defaulted
    5 |   constexpr bool operator== (const A&) const = default;
      |                                                ^~~~~~~
pr102490.C:5:18: warning: inline function ‘constexpr bool A::operator==(const
A&) const’ used but never defined
    5 |   constexpr bool operator== (const A&) const = default;
      |                  ^~~~~~~~
but since then it emits:
pr102490.C: In member function ‘constexpr bool A::operator==(const A&) const’:
pr102490.C:5:18: error: type mismatch in ‘component_ref’
    5 |   constexpr bool operator== (const A&) const = default;
      |                  ^~~~~~~~
unsigned char

<unnamed-unsigned:1>

_1 = this->foo;
pr102490.C:5:18: error: type mismatch in ‘component_ref’
unsigned char

<unnamed-unsigned:1>

_2 = D.2080->foo;
pr102490.C:5:18: error: type mismatch in ‘component_ref’
unsigned char

<unnamed-unsigned:1>

_3 = this->bar;
pr102490.C:5:18: error: type mismatch in ‘component_ref’
unsigned char

<unnamed-unsigned:1>

_4 = D.2080->bar;
pr102490.C:5:18: internal compiler error: ‘verify_gimple’ failed
at -O0 or miscompiles it at -O1.

  reply	other threads:[~2021-09-27 10:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-26 11:31 [Bug c++/102490] New: " luc.briand35 at gmail dot com
2021-09-27 10:16 ` jakub at gcc dot gnu.org [this message]
2021-09-27 11:33 ` [Bug c++/102490] " jakub at gcc dot gnu.org
2021-09-27 11:37 ` pinskia at gcc dot gnu.org
2021-09-27 12:38 ` jakub at gcc dot gnu.org
2021-10-05 17:15 ` jakub at gcc dot gnu.org
2021-10-06  2:41 ` cvs-commit at gcc dot gnu.org
2022-11-03 21:18 ` ppalka 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-102490-4-0rTFRes5nR@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).