public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110810] New: ICE in check_noexcept_r, at cp/except.cc:1068
@ 2023-07-25 19:15 cuzdav at gmail dot com
  2023-07-26  5:27 ` [Bug c++/110810] [12/13/14 Regression] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: cuzdav at gmail dot com @ 2023-07-25 19:15 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110810
           Summary: ICE in check_noexcept_r, at cp/except.cc:1068
           Product: gcc
           Version: 12.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cuzdav at gmail dot com
  Target Milestone: ---

Created attachment 55634
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55634&action=edit
preprocessed code, zipped

Starting with x86_64 version of gcc 12.1 (linux), and through all newer
versions (including the trunk) on Compiler explorer, I receive an internal
compiler error on the following code:

Some overlap with https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109899 but there
is enough difference that I thought it might still be useful to report.

https://godbolt.org/z/ThTdxqzKG

    #include <new>

    struct Foo {
        Foo() {}
        ~Foo() {}
    };

    struct X {
        Foo data[4];
    };

    template<class H>
    void f() {
        char storage[256];
        auto& object = *new(storage) X{};
        object.~X();
    }

* removing {} in the call to placement new "fixes" it, or replacing with
parenthesis.  Another fix is removing either the default ctor or destructor
from Foo, or making data not be an array, or f() not be a template.  It's a
strange and specific combination.

Output:


source>: In function 'void f()':
<source>:15:36: internal compiler error: in check_noexcept_r, at
cp/except.cc:1068
   15 |     auto& object = *new(storage) X{};
      |                                    ^
0x246af2e internal_error(char const*, ...)
        ???:0
0xac8ab6 fancy_abort(char const*, int, char const*)
        ???:0
0x16d661c walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0x16d9912 walk_tree_without_duplicates_1(tree_node**, tree_node*
(*)(tree_node**, int*, void*), void*, tree_node* (*)(tree_node**, int*,
tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false,
default_hash_traits<tree_node*> >*))
        ???:0
0xbd04a3 expr_noexcept_p(tree_node*, int)
        ???:0
0xbd64f0 build_vec_delete(unsigned int, tree_node*, tree_node*,
special_function_kind, int, int)
        ???:0
0xbd6a1e build_delete(unsigned int, tree_node*, tree_node*,
special_function_kind, int, int, int)
        ???:0
0xb8c5cc cxx_maybe_build_cleanup(tree_node*, int)
        ???:0
0xaf6b55 build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
        ???:0
0xaf78e7 build_special_member_call(tree_node*, tree_node*, vec<tree_node*,
va_gc, vl_embed>**, tree_node*, int, int)
        ???:0
0xbde5fc build_new(unsigned int, vec<tree_node*, va_gc, vl_embed>**,
tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, int, int)
        ???:0
0xcae89f c_parse_file()
        ???:0
0xdee919 c_common_parse_file()
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

* [Bug c++/110810] [12/13/14 Regression] ICE in check_noexcept_r, at cp/except.cc:1068
  2023-07-25 19:15 [Bug c++/110810] New: ICE in check_noexcept_r, at cp/except.cc:1068 cuzdav at gmail dot com
@ 2023-07-26  5:27 ` pinskia at gcc dot gnu.org
  2023-07-26  5:30 ` pinskia at gcc dot gnu.org
  2023-07-26  5:31 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-26  5:27 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|                            |2023-07-26
     Ever confirmed|0                           |1
   Target Milestone|---                         |12.4
      Known to fail|                            |12.1.0
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |11.4.0
            Summary|ICE in check_noexcept_r, at |[12/13/14 Regression] ICE
                   |cp/except.cc:1068           |in check_noexcept_r, at
                   |                            |cp/except.cc:1068

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
You don't even need it to be a inplacement new:
```

    struct Foo {
        Foo() {}
        ~Foo() {}
    };

    struct X {
        Foo data[4];
    };

    template<class H>
    void f() {
        auto& object = *new X{};
        object.~X();
    }
```

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

* [Bug c++/110810] [12/13/14 Regression] ICE in check_noexcept_r, at cp/except.cc:1068
  2023-07-25 19:15 [Bug c++/110810] New: ICE in check_noexcept_r, at cp/except.cc:1068 cuzdav at gmail dot com
  2023-07-26  5:27 ` [Bug c++/110810] [12/13/14 Regression] " pinskia at gcc dot gnu.org
@ 2023-07-26  5:30 ` pinskia at gcc dot gnu.org
  2023-07-26  5:31 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-26  5:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
You don't even need it to be a new or even ~X there:
```
    struct Foo {
        Foo() {}
        ~Foo() {}
    };

    struct X {
        Foo data[4];
    };

    template<int>
    void f() {
        X{};
    }
```

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

* [Bug c++/110810] [12/13/14 Regression] ICE in check_noexcept_r, at cp/except.cc:1068
  2023-07-25 19:15 [Bug c++/110810] New: ICE in check_noexcept_r, at cp/except.cc:1068 cuzdav at gmail dot com
  2023-07-26  5:27 ` [Bug c++/110810] [12/13/14 Regression] " pinskia at gcc dot gnu.org
  2023-07-26  5:30 ` pinskia at gcc dot gnu.org
@ 2023-07-26  5:31 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-26  5:31 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
It is a dup of bug 109899 in the end (will show why there in a second).

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

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

end of thread, other threads:[~2023-07-26  5:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-25 19:15 [Bug c++/110810] New: ICE in check_noexcept_r, at cp/except.cc:1068 cuzdav at gmail dot com
2023-07-26  5:27 ` [Bug c++/110810] [12/13/14 Regression] " pinskia at gcc dot gnu.org
2023-07-26  5:30 ` pinskia at gcc dot gnu.org
2023-07-26  5:31 ` pinskia 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).