public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/115501] New: ICE: in build_call_a, at cp/call.cc:370
@ 2024-06-15  4:10 iamanonymous.cs at gmail dot com
  2024-06-15  4:52 ` [Bug c++/115501] " pinskia at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: iamanonymous.cs at gmail dot com @ 2024-06-15  4:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115501
           Summary: ICE: in build_call_a, at cp/call.cc:370
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
            Target: x86_64

*******************************************************************************
The compiler produces an internal error when compiling the provided code with
the specified options. 
The issue can also be reproduced on Compiler Explorer.

*******************************************************************************
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
*******************************************************************************
# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
*******************************************************************************
Program:
# 2.ii

namespace std
{
  class exception
  {
    virtual ~exception() throw();
  };
}
namespace std __attribute__((__visibility__("default")))
{
  template <typename _CharT, typename _Traits = char_traits<_CharT>, typename
_Alloc = allocator<_CharT>>
  class basic_string;
  typedef basic_string<char> string;
}
namespace boost
{
  class exception
  {
  };
}
namespace __cxxabiv1
{
  extern "C" void *__dynamic_cast(const void *__src_ptr, const
__class_type_info *__src_type, const __class_type_info *__dst_type, ptrdiff_t
__src2dst);
  inline std::string diagnostic_information_impl(boost::exception const *be,
std::exception const *se, bool with_what)
  {
    if (!be)
      be = dynamic_cast<boost::exception const *>(se);
  }
}

*******************************************************************************
Command Lines:
# g++ 2.ii  -std=c++17 -O2 -Wall -Wextra -pedantic -Wshadow -Wnon-virtual-dtor
-Wold-style-cast -Wcast-align -Woverloaded-virtual -Wconversion
-Wsign-conversion -Wmisleading-indentation -Wduplicated-cond
-Wduplicated-branches -Wlogical-op -Wnull-dereference -Wuseless-cast
-Wdouble-promotion -Wformat=2 -Wnoexcept -fstack-protector-strong
-D_GLIBCXX_ASSERTIONS -fvisibility=hidden -fvisibility-inlines-hidden -o -c 2.o
2.ii:10:49: error: ‘char_traits’ does not name a type
   10 |   template <typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT>>
      |                                                 ^~~~~~~~~~~
2.ii:10:60: error: expected ‘>’ before ‘<’ token
   10 |   template <typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT>>
      |                                                            ^
2.ii:12:28: error: template argument 2 is invalid
   12 |   typedef basic_string<char> string;
      |                            ^
2.ii:22:64: error: ‘__class_type_info’ does not name a type
   22 |   extern "C" void *__dynamic_cast(const void *__src_ptr, const
__class_type_info *__src_type, const __class_type_info *__dst_type, ptrdiff_t
__src2dst);
      |                                                               
^~~~~~~~~~~~~~~~~
2.ii:22:101: error: ‘__class_type_info’ does not name a type
   22 |   extern "C" void *__dynamic_cast(const void *__src_ptr, const
__class_type_info *__src_type, const __class_type_info *__dst_type, ptrdiff_t
__src2dst);
      |                                                                        
                            ^~~~~~~~~~~~~~~~~
2.ii:22:132: error: ‘ptrdiff_t’ has not been declared
   22 |   extern "C" void *__dynamic_cast(const void *__src_ptr, const
__class_type_info *__src_type, const __class_type_info *__dst_type, ptrdiff_t
__src2dst);
      |                                                                        
                                                           ^~~~~~~~~
<built-in>: error: conflicting declaration of C function ‘void*
__cxxabiv1::__dynamic_cast(const void*, const __class_type_info*, const
__class_type_info*, long int)’
2.ii:22:20: note: previous declaration ‘void* __cxxabiv1::__dynamic_cast(const
void*, const int*, const int*, int)’
   22 |   extern "C" void *__dynamic_cast(const void *__src_ptr, const
__class_type_info *__src_type, const __class_type_info *__dst_type, ptrdiff_t
__src2dst);
      |                    ^~~~~~~~~~~~~~
2.ii: In function ‘std::string __cxxabiv1::diagnostic_information_impl(const
boost::exception*, const std::exception*, bool)’:
2.ii:26:53: internal compiler error: in build_call_a, at cp/call.cc:370
   26 |       be = dynamic_cast<boost::exception const *>(se);
      |                                                     ^
0x7958c9 build_call_a(tree_node*, int, tree_node**)
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/call.cc:370
0xaa4a20 build_cxx_call(tree_node*, int, tree_node**, int, tree_node*)
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/call.cc:11083
0xcf87e6 build_dynamic_cast_1
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/rtti.cc:797
0xcf87e6 build_dynamic_cast(unsigned int, tree_node*, tree_node*, int)
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/rtti.cc:846
0xc6a538 cp_parser_postfix_expression
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:7598
0xc44eeb cp_parser_binary_expression
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:10398
0xc45c54 cp_parser_assignment_expression
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:10742
0xc46d9d cp_parser_constant_expression
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:11032
0xc47e66 cp_parser_initializer_clause
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:26229
0xc45f1a cp_parser_assignment_expression
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:10760
0xc461f4 cp_parser_expression
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:10909
0xc4c927 cp_parser_expression_statement
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:13175
0xc8515b cp_parser_statement
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:12952
0xc86291 cp_parser_implicitly_scoped_statement
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:15006
0xc86901 cp_parser_selection_statement
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:13703
0xc85105 cp_parser_statement
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:12726
0xc59807 cp_parser_statement_seq_opt
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:13427
0xc59a2f cp_parser_compound_statement
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:13281
0xc7ccd5 cp_parser_function_body
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:26072
0xc7ccd5 cp_parser_ctor_initializer_opt_and_function_body
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:26123
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.
*******************************************************************************

Also ICE on trunk, compiler explorer:https://godbolt.org/z/frzM5b4cq

*******************************************************************************

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

* [Bug c++/115501] ICE: in build_call_a, at cp/call.cc:370
  2024-06-15  4:10 [Bug c/115501] New: ICE: in build_call_a, at cp/call.cc:370 iamanonymous.cs at gmail dot com
@ 2024-06-15  4:52 ` pinskia at gcc dot gnu.org
  2024-06-15  4:55 ` [Bug c++/115501] [13/14/15 Regression] ICE: in build_call_a with dynamic_cast after invalid definition of __cxxabiv1::__dynamic_cast pinskia at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-15  4:52 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |error-recovery,
                   |                            |ice-on-invalid-code

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced testcase:
```
struct s{virtual void f();};
struct s1 : s{};
namespace __cxxabiv1
{
  extern "C" void __dynamic_cast();
}
void diagnostic_information_impl(s const *se)
{
  dynamic_cast<s1 const *>(se);
}
```

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

* [Bug c++/115501] [13/14/15 Regression] ICE: in build_call_a with dynamic_cast after invalid definition of __cxxabiv1::__dynamic_cast
  2024-06-15  4:10 [Bug c/115501] New: ICE: in build_call_a, at cp/call.cc:370 iamanonymous.cs at gmail dot com
  2024-06-15  4:52 ` [Bug c++/115501] " pinskia at gcc dot gnu.org
@ 2024-06-15  4:55 ` pinskia at gcc dot gnu.org
  2024-06-15  4:56 ` pinskia at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-15  4:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2024-06-15
   Target Milestone|---                         |13.4
            Summary|ICE: in build_call_a, at    |[13/14/15 Regression] ICE:
                   |cp/call.cc:370              |in build_call_a with
                   |                            |dynamic_cast after invalid
                   |                            |definition of
                   |                            |__cxxabiv1::__dynamic_cast
           Keywords|                            |needs-bisection
      Known to fail|                            |13.1.0

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. The ICE started in GCC 13.

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

* [Bug c++/115501] [13/14/15 Regression] ICE: in build_call_a with dynamic_cast after invalid definition of __cxxabiv1::__dynamic_cast
  2024-06-15  4:10 [Bug c/115501] New: ICE: in build_call_a, at cp/call.cc:370 iamanonymous.cs at gmail dot com
  2024-06-15  4:52 ` [Bug c++/115501] " pinskia at gcc dot gnu.org
  2024-06-15  4:55 ` [Bug c++/115501] [13/14/15 Regression] ICE: in build_call_a with dynamic_cast after invalid definition of __cxxabiv1::__dynamic_cast pinskia at gcc dot gnu.org
@ 2024-06-15  4:56 ` pinskia at gcc dot gnu.org
  2024-06-15  5:00 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-15  4:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #2)
> Confirmed. The ICE started in GCC 13.

Before it was accepted.

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

* [Bug c++/115501] [13/14/15 Regression] ICE: in build_call_a with dynamic_cast after invalid definition of __cxxabiv1::__dynamic_cast
  2024-06-15  4:10 [Bug c/115501] New: ICE: in build_call_a, at cp/call.cc:370 iamanonymous.cs at gmail dot com
                   ` (2 preceding siblings ...)
  2024-06-15  4:56 ` pinskia at gcc dot gnu.org
@ 2024-06-15  5:00 ` pinskia at gcc dot gnu.org
  2024-06-17 11:17 ` [Bug c++/115501] [13/14/15 Regression] ICE: in build_call_a with dynamic_cast after invalid definition of __cxxabiv1::__dynamic_cast since r13-3299 jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-15  5:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ppalka at gcc dot gnu.org

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Most likely r13-3299-gd6a488f243acfa .

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

* [Bug c++/115501] [13/14/15 Regression] ICE: in build_call_a with dynamic_cast after invalid definition of __cxxabiv1::__dynamic_cast since r13-3299
  2024-06-15  4:10 [Bug c/115501] New: ICE: in build_call_a, at cp/call.cc:370 iamanonymous.cs at gmail dot com
                   ` (3 preceding siblings ...)
  2024-06-15  5:00 ` pinskia at gcc dot gnu.org
@ 2024-06-17 11:17 ` jakub at gcc dot gnu.org
  2024-06-17 19:28 ` mpolacek at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-06-17 11:17 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org
           Keywords|needs-bisection             |
           Priority|P3                          |P2
            Summary|[13/14/15 Regression] ICE:  |[13/14/15 Regression] ICE:
                   |in build_call_a with        |in build_call_a with
                   |dynamic_cast after invalid  |dynamic_cast after invalid
                   |definition of               |definition of
                   |__cxxabiv1::__dynamic_cast  |__cxxabiv1::__dynamic_cast
                   |                            |since r13-3299

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Confirming this started with r13-3299-gd6a488f243acfac4bdbbb0eefbee3ae916159cf5

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

* [Bug c++/115501] [13/14/15 Regression] ICE: in build_call_a with dynamic_cast after invalid definition of __cxxabiv1::__dynamic_cast since r13-3299
  2024-06-15  4:10 [Bug c/115501] New: ICE: in build_call_a, at cp/call.cc:370 iamanonymous.cs at gmail dot com
                   ` (4 preceding siblings ...)
  2024-06-17 11:17 ` [Bug c++/115501] [13/14/15 Regression] ICE: in build_call_a with dynamic_cast after invalid definition of __cxxabiv1::__dynamic_cast since r13-3299 jakub at gcc dot gnu.org
@ 2024-06-17 19:28 ` mpolacek at gcc dot gnu.org
  2024-06-17 23:24 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-06-17 19:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
build_dynamic_cast_1 now calls pushdecl which calls duplicate_decls and that
emits the "conflicting declaration" error and returns error_mark_node, so the
subsequent build_cxx_call crashes on the error_mark_node.

Maybe we need just:

--- a/gcc/cp/rtti.cc
+++ b/gcc/cp/rtti.cc
@@ -793,6 +793,8 @@ build_dynamic_cast_1 (location_t loc, tree type, tree expr,
          dcast_fn = pushdecl (dcast_fn, /*hiding=*/true);
          pop_abi_namespace (flags);
          dynamic_cast_node = dcast_fn;
+         if (dcast_fn == error_mark_node)
+       return error_mark_node;
        }
      result = build_cxx_call (dcast_fn, 4, elems, complain);
      SET_EXPR_LOCATION (result, loc);

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

* [Bug c++/115501] [13/14/15 Regression] ICE: in build_call_a with dynamic_cast after invalid definition of __cxxabiv1::__dynamic_cast since r13-3299
  2024-06-15  4:10 [Bug c/115501] New: ICE: in build_call_a, at cp/call.cc:370 iamanonymous.cs at gmail dot com
                   ` (5 preceding siblings ...)
  2024-06-17 19:28 ` mpolacek at gcc dot gnu.org
@ 2024-06-17 23:24 ` pinskia at gcc dot gnu.org
  2024-06-18 13:42 ` mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-17 23:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu.org

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Marek Polacek from comment #6)
> build_dynamic_cast_1 now calls pushdecl which calls duplicate_decls and that
> emits the "conflicting declaration" error and returns error_mark_node, so
> the subsequent build_cxx_call crashes on the error_mark_node.
> 
> Maybe we need just:
> 
> --- a/gcc/cp/rtti.cc
> +++ b/gcc/cp/rtti.cc
> @@ -793,6 +793,8 @@ build_dynamic_cast_1 (location_t loc, tree type, tree
> expr,
>           dcast_fn = pushdecl (dcast_fn, /*hiding=*/true);
>           pop_abi_namespace (flags);
>           dynamic_cast_node = dcast_fn;
> +         if (dcast_fn == error_mark_node)
> +       return error_mark_node;
>         }
>       result = build_cxx_call (dcast_fn, 4, elems, complain);
>       SET_EXPR_LOCATION (result, loc);

Most likely that check should be after the `!dcast_fn` check rather than inside
it so if you try to use dynamic_cast twice, the second one would not cause an
ICE.

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

* [Bug c++/115501] [13/14/15 Regression] ICE: in build_call_a with dynamic_cast after invalid definition of __cxxabiv1::__dynamic_cast since r13-3299
  2024-06-15  4:10 [Bug c/115501] New: ICE: in build_call_a, at cp/call.cc:370 iamanonymous.cs at gmail dot com
                   ` (6 preceding siblings ...)
  2024-06-17 23:24 ` pinskia at gcc dot gnu.org
@ 2024-06-18 13:42 ` mpolacek at gcc dot gnu.org
  2024-06-23 11:29 ` iamanonymous.cs at gmail dot com
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-06-18 13:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org

--- Comment #8 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Good point, I'll test that.

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

* [Bug c++/115501] [13/14/15 Regression] ICE: in build_call_a with dynamic_cast after invalid definition of __cxxabiv1::__dynamic_cast since r13-3299
  2024-06-15  4:10 [Bug c/115501] New: ICE: in build_call_a, at cp/call.cc:370 iamanonymous.cs at gmail dot com
                   ` (7 preceding siblings ...)
  2024-06-18 13:42 ` mpolacek at gcc dot gnu.org
@ 2024-06-23 11:29 ` iamanonymous.cs at gmail dot com
  2024-06-25 19:10 ` cvs-commit at gcc dot gnu.org
  2024-06-25 19:10 ` [Bug c++/115501] [13/14 " mpolacek at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: iamanonymous.cs at gmail dot com @ 2024-06-23 11:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Anonymous <iamanonymous.cs at gmail dot com> ---
*** Bug 115598 has been marked as a duplicate of this bug. ***

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

* [Bug c++/115501] [13/14/15 Regression] ICE: in build_call_a with dynamic_cast after invalid definition of __cxxabiv1::__dynamic_cast since r13-3299
  2024-06-15  4:10 [Bug c/115501] New: ICE: in build_call_a, at cp/call.cc:370 iamanonymous.cs at gmail dot com
                   ` (8 preceding siblings ...)
  2024-06-23 11:29 ` iamanonymous.cs at gmail dot com
@ 2024-06-25 19:10 ` cvs-commit at gcc dot gnu.org
  2024-06-25 19:10 ` [Bug c++/115501] [13/14 " mpolacek at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-25 19:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:

https://gcc.gnu.org/g:71f484d02b2b3e8616cd7af27a0d4c72e4c7e977

commit r15-1620-g71f484d02b2b3e8616cd7af27a0d4c72e4c7e977
Author: Marek Polacek <polacek@redhat.com>
Date:   Tue Jun 18 10:50:49 2024 -0400

    c++: ICE with __dynamic_cast redecl [PR115501]

    Since r13-3299, build_dynamic_cast_1 calls pushdecl which calls
    duplicate_decls and that in this testcase emits the "conflicting
    declaration" error and returns error_mark_node, so the subsequent
    build_cxx_call crashes on the error_mark_node.

            PR c++/115501

    gcc/cp/ChangeLog:

            * rtti.cc (build_dynamic_cast_1): Return if dcast_fn is erroneous.

    gcc/testsuite/ChangeLog:

            * g++.dg/rtti/dyncast8.C: New test.

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

* [Bug c++/115501] [13/14 Regression] ICE: in build_call_a with dynamic_cast after invalid definition of __cxxabiv1::__dynamic_cast since r13-3299
  2024-06-15  4:10 [Bug c/115501] New: ICE: in build_call_a, at cp/call.cc:370 iamanonymous.cs at gmail dot com
                   ` (9 preceding siblings ...)
  2024-06-25 19:10 ` cvs-commit at gcc dot gnu.org
@ 2024-06-25 19:10 ` mpolacek at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-06-25 19:10 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[13/14/15 Regression] ICE:  |[13/14 Regression] ICE: in
                   |in build_call_a with        |build_call_a with
                   |dynamic_cast after invalid  |dynamic_cast after invalid
                   |definition of               |definition of
                   |__cxxabiv1::__dynamic_cast  |__cxxabiv1::__dynamic_cast
                   |since r13-3299              |since r13-3299
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #11 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed on trunk.

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

end of thread, other threads:[~2024-06-25 19:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-15  4:10 [Bug c/115501] New: ICE: in build_call_a, at cp/call.cc:370 iamanonymous.cs at gmail dot com
2024-06-15  4:52 ` [Bug c++/115501] " pinskia at gcc dot gnu.org
2024-06-15  4:55 ` [Bug c++/115501] [13/14/15 Regression] ICE: in build_call_a with dynamic_cast after invalid definition of __cxxabiv1::__dynamic_cast pinskia at gcc dot gnu.org
2024-06-15  4:56 ` pinskia at gcc dot gnu.org
2024-06-15  5:00 ` pinskia at gcc dot gnu.org
2024-06-17 11:17 ` [Bug c++/115501] [13/14/15 Regression] ICE: in build_call_a with dynamic_cast after invalid definition of __cxxabiv1::__dynamic_cast since r13-3299 jakub at gcc dot gnu.org
2024-06-17 19:28 ` mpolacek at gcc dot gnu.org
2024-06-17 23:24 ` pinskia at gcc dot gnu.org
2024-06-18 13:42 ` mpolacek at gcc dot gnu.org
2024-06-23 11:29 ` iamanonymous.cs at gmail dot com
2024-06-25 19:10 ` cvs-commit at gcc dot gnu.org
2024-06-25 19:10 ` [Bug c++/115501] [13/14 " 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).