public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/108755] New: ICE in use_thunk at cp/method.cc:317
@ 2023-02-10 18:57 ramir.sultano at ya dot ru
  2023-02-10 19:01 ` [Bug c++/108755] " mpolacek at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: ramir.sultano at ya dot ru @ 2023-02-10 18:57 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108755
           Summary: ICE in use_thunk at cp/method.cc:317
           Product: gcc
           Version: 12.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ramir.sultano at ya dot ru
  Target Milestone: ---

gcc version 12.2.1 20230111 (GCC)

Target: x86_64-pc-linux-gnu

Configured with: /build/gcc/src/gcc/configure
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --enable-bootstrap
--prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--with-build-config=bootstrap-lto --with-linker-hash-style=gnu
--with-system-zlib --enable-__cxa_atexit --enable-cet=auto
--enable-checking=release --enable-clocale=gnu --enable-default-pie
--enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object
--enable-libstdcxx-backtrace --enable-link-serialization=1
--enable-linker-build-id --enable-lto --enable-multilib --enable-plugin
--enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch
--disable-werror

The complete command line that triggers the bug: g++ main.cxx

The compiler output (error messages, warnings, etc.):
main.cxx: In instantiation of ‘constexpr X AB<X>::b() const [with X = bool]’:
main.cxx:21:23:   required from here
main.cxx:14:49: internal compiler error: in use_thunk, at cp/method.cc:317
   14 |     constexpr X b() const override { return {}; };
      |                                                 ^
0x19e2ee8 internal_error(char const*, ...)
        ???:0
0x65443c fancy_abort(char const*, int, char const*)
        ???:0
0x813cb0 emit_associated_thunks(tree_node*)
        ???:0
0x7db493 instantiate_decl(tree_node*, bool, bool)
        ???:0
0x6a7b96 maybe_constant_value(tree_node*, tree_node*, bool)
        ???:0
0x84a9ba cp_build_binary_op(op_location_t const&, tree_code, tree_node*,
tree_node*, int)
        ???:0
0x69acb2 build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node*, tree_node**, int)
        ???:0
0x852fbb build_x_binary_op(op_location_t const&, tree_code, tree_node*,
tree_code, tree_node*, tree_code, tree_node*, tree_node**, int)
        ???:0
0x7c7d9c c_parse_file()
        ???:0
0x8dd47d c_common_parse_file()
        ???:0

The preprocessed file (*.i*) that triggers the bug, generated by adding
-save-temps to the complete compilation command:
template <class X>
struct A {
    constexpr virtual X a() const = 0;
};

template <class X>
struct B {
    constexpr virtual X b() const = 0;
};

template <class X>
struct AB : public A<X>, public B<X> {
    constexpr X a() const override { return {}; };
    constexpr X b() const override { return {}; };
};

int main() {
    using x_type = bool;
    constexpr AB<x_type> ab{};
    static_assert(ab.a() == x_type{});
    static_assert(ab.b() == x_type{});

    return 0;
}

Notes:
possible duplicate of
[91846](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91846)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/108755] ICE in use_thunk at cp/method.cc:317
  2023-02-10 18:57 [Bug c++/108755] New: ICE in use_thunk at cp/method.cc:317 ramir.sultano at ya dot ru
@ 2023-02-10 19:01 ` mpolacek at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2023-02-10 19:01 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Yeah, I think they're duplicates.

*** This bug has been marked as a duplicate of bug 91846 ***

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-10 19:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-10 18:57 [Bug c++/108755] New: ICE in use_thunk at cp/method.cc:317 ramir.sultano at ya dot ru
2023-02-10 19:01 ` [Bug c++/108755] " mpolacek at gcc dot gnu.org

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).