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

            Bug ID: 117505
           Summary: ICE on x86_64-linux-gnu: Segmentation fault with
                    __attribute__(used)
           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: ---

Compiler Explorer: https://godbolt.org/z/9a3qP7nb8

*******************************************************************************
gcc version:
Using built-in specs.
COLLECT_GCC=/home/software/gcc-trunk/bin/gcc
COLLECT_LTO_WRAPPER=/home/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --disable-bootstrap --enable-checking=yes
--prefix=/home/software/gcc-trunk --enable-sanitizers --enable-languages=c,c++
--disable-werror --enable-multilib --enable-coverage
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20241107 (experimental) (GCC)

*******************************************************************************
Program:
$ cat mutant.C
typedef struct {
  template <class> struct a {
    void __attribute__((used)) b() {}
  };
} c;

*******************************************************************************
Command Lines:
$ gcc mutant.C
mutant.C:5:4: internal compiler error: Segmentation fault
    5 | } c;
      |    ^
0x5cdf4f4 internal_error(char const*, ...)
        ../../gcc/gcc/diagnostic-global-context.cc:518
0x2694272 crash_signal
        ../../gcc/gcc/toplev.cc:323
0xe6c6cd tree_check(tree_node*, char const*, int, char const*, tree_code)
        ../../gcc/gcc/tree.h:3642
0x2f3fca6 ultimate_transparent_alias_target
        ../../gcc/gcc/varasm.cc:1388
0x2f42543 notice_global_symbol(tree_node*)
        ../../gcc/gcc/varasm.cc:1795
0x19f8ba0 cgraph_node::finalize_function(tree_node*, bool)
        ../../gcc/gcc/cgraphunit.cc:465
0x159415c expand_or_defer_fn(tree_node*)
        ../../gcc/gcc/cp/semantics.cc:5274
0x112ae7e c_parse_final_cleanups()
        ../../gcc/gcc/cp/decl2.cc:5512
0x17c07d3 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.cc:1370
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