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

            Bug ID: 123407
           Summary: nternal compiler error: Segmentation fault with
                    redeclared symbols
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: d
          Assignee: ibuclaw at gdcproject dot org
          Reporter: ibuclaw at gcc dot gnu.org
  Target Milestone: ---

Merging global symbols with the same mangle name doesn't take into account it
might be a  redeclaration of a different kind of symbol.

```
pragma(mangle, "ice") int fun();
pragma(mangle, "ice") int var;
```

ice.d:2:27: internal compiler error: Segmentation fault
    2 | pragma(mangle, "ice") int var;
      |                           ^
0x2a39c4b internal_error(char const*, ...)
        ../../gcc/diagnostic-global-context.cc:517
0x14d94ba crash_signal
        ../../gcc/toplev.cc:321
0x7795b0ea932f ???
        ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0xce66f4 FuncDeclaration::needThis()
        ../../gcc/d/dmd/func.d:755
0xe2eece get_symbol_decl(Declaration*)
        ../../gcc/d/decl.cc:1425
0xe2eece get_symbol_decl(Declaration*)
        ../../gcc/d/decl.cc:1209
0xe33e45 DeclVisitor::visit(VarDeclaration*)
        ../../gcc/d/decl.cc:800
0xe339e5 DeclVisitor::build_dsymbol(Dsymbol*)
        ../../gcc/d/decl.cc:245
0xe339e5 DeclVisitor::visit(AttribDeclaration*)
        ../../gcc/d/decl.cc:360
0xe339e5 DeclVisitor::visit(PragmaDeclaration*)
        ../../gcc/d/decl.cc:378
0xe2d53f DeclVisitor::build_dsymbol(Dsymbol*)
        ../../gcc/d/decl.cc:245
0xe2d53f build_decl_tree(Dsymbol*)
        ../../gcc/d/decl.cc:1126
0xe449d0 build_module_tree(Module*)
        ../../gcc/d/modules.cc:734
0xe31247 DeclVisitor::visit(Module*)
        ../../gcc/d/decl.cc:262
0xe2d53f DeclVisitor::build_dsymbol(Dsymbol*)
        ../../gcc/d/decl.cc:245
0xe2d53f build_decl_tree(Dsymbol*)
        ../../gcc/d/decl.cc:1126
0xe29223 d_parse_file
        ../../gcc/d/d-lang.cc:1432
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.

Reply via email to