public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98417] New: -internal compiler error when using -g
@ 2020-12-22 10:12 patrick.kox at commandoregel dot be
  2020-12-22 11:22 ` [Bug c++/98417] ICE when using C++ modules and -g marxin at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: patrick.kox at commandoregel dot be @ 2020-12-22 10:12 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98417
           Summary: -internal compiler error when using -g
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: patrick.kox at commandoregel dot be
  Target Milestone: ---

I'm new so I hope this is the correct way to report this.

When using the -g flag with the C++20 modules example from the wiki
(https://gcc.gnu.org/wiki/cxx-modules) the compiler gives an internal compiler
error.

This is with version (g++ (GCC) 11.0.0 20201220 (experimental)).
The output of the compiler is:

g++ -g -Wall -fmodules-ts   -c -MMD -MP -o hello.o hello.cc
g++ -g -Wall -fmodules-ts   -c -MMD -MP -o main.o main.cc
main.cc: In function ‘int main()’:
main.cc:11:3: internal compiler error: in gen_typedef_die, at dwarf2out.c:25373
   11 |   greeter ("world");
      |   ^~~~~~~
0x7471d6 gen_typedef_die
        ../.././gcc/dwarf2out.c:25373
0x7471d6 gen_typedef_die
        ../.././gcc/dwarf2out.c:25345
0xcef8fa gen_decl_die
        ../.././gcc/dwarf2out.c:26377
0xcf1b13 gen_member_die
        ../.././gcc/dwarf2out.c:25188
0xcf1b13 gen_struct_or_union_type_die
        ../.././gcc/dwarf2out.c:25284
0xcf1b13 gen_tagged_type_die
        ../.././gcc/dwarf2out.c:25485
0xd0c8d9 gen_tagged_type_die
        ../.././gcc/dwarf2out.c:25439
0xd0c8d9 gen_typedef_die
        ../.././gcc/dwarf2out.c:25399
0xd0c8d9 gen_typedef_die
        ../.././gcc/dwarf2out.c:25345
0xcef8fa gen_decl_die
        ../.././gcc/dwarf2out.c:26377
0xcf4426 gen_type_die
        ../.././gcc/dwarf2out.c:25735
0xcef3c2 gen_decl_die
        ../.././gcc/dwarf2out.c:26374
0xcf05b3 dwarf2out_decl
        ../.././gcc/dwarf2out.c:26929
0xcf0b41 dwarf2out_type_decl
        ../.././gcc/dwarf2out.c:26647
0xcf0b41 dwarf2out_type_decl
        ../.././gcc/dwarf2out.c:26642
0xfd75f4 rest_of_type_compilation(tree_node*, int)
        ../.././gcc/passes.c:339
0xa1ec9d trees_in::read_class_def(tree_node*, tree_node*)
        ../.././gcc/cp/module.cc:12161
0xa204d9 module_state::read_cluster(unsigned int)
        ../.././gcc/cp/module.cc:14901
0xa20cfd module_state::load_section(unsigned int, binding_slot*)
        ../.././gcc/cp/module.cc:18032
0xa20dbf module_state::lazy_load(unsigned int, binding_slot*)
        ../.././gcc/cp/module.cc:18681
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
make: *** [<builtin>: main.o] Error 1

removing the -g flag from the command solves the issue

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

* [Bug c++/98417] ICE when using C++ modules and -g
  2020-12-22 10:12 [Bug c++/98417] New: -internal compiler error when using -g patrick.kox at commandoregel dot be
@ 2020-12-22 11:22 ` marxin at gcc dot gnu.org
  2021-01-18  6:57 ` boris at kolpackov dot net
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-12-22 11:22 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-12-22
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |nathan at gcc dot gnu.org
            Summary|-internal compiler error    |ICE when using C++ modules
                   |when using -g               |and -g

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

* [Bug c++/98417] ICE when using C++ modules and -g
  2020-12-22 10:12 [Bug c++/98417] New: -internal compiler error when using -g patrick.kox at commandoregel dot be
  2020-12-22 11:22 ` [Bug c++/98417] ICE when using C++ modules and -g marxin at gcc dot gnu.org
@ 2021-01-18  6:57 ` boris at kolpackov dot net
  2022-04-26 20:29 ` remi.galanalfonso at gmail dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: boris at kolpackov dot net @ 2021-01-18  6:57 UTC (permalink / raw)
  To: gcc-bugs

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

Boris Kolpackov <boris at kolpackov dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |boris at kolpackov dot net

--- Comment #1 from Boris Kolpackov <boris at kolpackov dot net> ---
I am also seeing this.

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

* [Bug c++/98417] ICE when using C++ modules and -g
  2020-12-22 10:12 [Bug c++/98417] New: -internal compiler error when using -g patrick.kox at commandoregel dot be
  2020-12-22 11:22 ` [Bug c++/98417] ICE when using C++ modules and -g marxin at gcc dot gnu.org
  2021-01-18  6:57 ` boris at kolpackov dot net
@ 2022-04-26 20:29 ` remi.galanalfonso at gmail dot com
  2022-04-27 10:45 ` boris at kolpackov dot net
  2024-02-11 14:23 ` nshead at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: remi.galanalfonso at gmail dot com @ 2022-04-26 20:29 UTC (permalink / raw)
  To: gcc-bugs

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

Rémi Galan Alfonso <remi.galanalfonso at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |remi.galanalfonso at gmail dot com

--- Comment #2 from Rémi Galan Alfonso <remi.galanalfonso at gmail dot com> ---
Hello,

I'm unable to reproduce it on any released gcc-11 or on trunk (but can with a
gcc from 2020-12-20).

Reduction gives me for hello.cc:
    module;
    # 1 "" 1 
    namespace std {
    template<class >
    struct char_traits;
    }
    typedef struct {} mbstate_t;
    namespace std {
    template<>
    struct char_traits<char> {
    mbstate_t state_type;                     
    };
    template<typename _CharT, typename = char_traits<_CharT>>
    class basic_string_view {
    public: basic_string_view(const _CharT* ){};
    };
    using string_view = basic_string_view<char>;                      
    }
    # 3 "" 2
    export module hello;
    export void greeter(std::string_view){}

If we accept invalid test case this and main.cc can be further reduced into:
 - hello.cc
    module;
    # 1 "" 1
    template <class> struct char_traits;
    typedef struct {
    } __mbstate_t;
    template <> struct char_traits<char> { __mbstate_t state_type; };
    template <typename _CharT, typename = char_traits<_CharT>>
    class basic_string_view;
    using string_view = basic_string_view<char>;
    # 3 "" 2
    export module hello;
    void greeter(string_view);

 - main.cc
    import hello;
    greeter

Bisection points me to the following commit as the one fixing the bug:
    commit 47145e6916f58e1cd4f562c06fa7289da49f690c
    Author: Nathan Sidwell <nathan@acm.org>
    Date:   Tue Feb 23 07:08:55 2021 -0800

        c++: typedef for linkage [PR 99208]

As this is the first time I use cvise, you probably want to double check those
informations.

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

* [Bug c++/98417] ICE when using C++ modules and -g
  2020-12-22 10:12 [Bug c++/98417] New: -internal compiler error when using -g patrick.kox at commandoregel dot be
                   ` (2 preceding siblings ...)
  2022-04-26 20:29 ` remi.galanalfonso at gmail dot com
@ 2022-04-27 10:45 ` boris at kolpackov dot net
  2024-02-11 14:23 ` nshead at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: boris at kolpackov dot net @ 2022-04-27 10:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Boris Kolpackov <boris at kolpackov dot net> ---
I also no longer see this with GCC 12.0.1 20220421.

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

* [Bug c++/98417] ICE when using C++ modules and -g
  2020-12-22 10:12 [Bug c++/98417] New: -internal compiler error when using -g patrick.kox at commandoregel dot be
                   ` (3 preceding siblings ...)
  2022-04-27 10:45 ` boris at kolpackov dot net
@ 2024-02-11 14:23 ` nshead at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: nshead at gcc dot gnu.org @ 2024-02-11 14:23 UTC (permalink / raw)
  To: gcc-bugs

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

Nathaniel Shead <nshead at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nshead at gcc dot gnu.org
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #4 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
Then fixed.

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

end of thread, other threads:[~2024-02-11 14:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-22 10:12 [Bug c++/98417] New: -internal compiler error when using -g patrick.kox at commandoregel dot be
2020-12-22 11:22 ` [Bug c++/98417] ICE when using C++ modules and -g marxin at gcc dot gnu.org
2021-01-18  6:57 ` boris at kolpackov dot net
2022-04-26 20:29 ` remi.galanalfonso at gmail dot com
2022-04-27 10:45 ` boris at kolpackov dot net
2024-02-11 14:23 ` nshead 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).