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

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