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

            Bug ID: 67405
           Summary: ICE on invalid use of struct on x86_64-linux-gnu
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

The following code causes an ICE when compiled with the current gcc trunk on
x86_64-linux-gnu.  


$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20150830 (experimental) [trunk revision 227326] (GCC) 
$ 
$ g++-trunk small.cc
small.cc:3:5: error: field ‘f’ has incomplete type ‘S’
   S f;
     ^
small.cc:1:8: note: definition of ‘struct S’ is not complete until the closing
brace
 struct S
        ^
small.cc: In function ‘void fn1(S)’:
small.cc:7:1: internal compiler error: Segmentation fault
 fn1 (S p1)
 ^
0xc8051f crash_signal
        ../../gcc-trunk/gcc/toplev.c:352
0xd32808 tree_int_cst_elt_check(tree_node*, int, char const*, int, char const*)
        ../../gcc-trunk/gcc/tree.h:3057
0xd32808 chkp_find_bound_slots_1(tree_node const*, bitmap_head*, long)
        ../../gcc-trunk/gcc/tree-chkp.c:1671
0xd32b9e chkp_find_bound_slots(tree_node const*, bitmap_head*)
        ../../gcc-trunk/gcc/tree-chkp.c:1702
0xd32b9e chkp_type_bounds_count(tree_node const*)
        ../../gcc-trunk/gcc/tree-chkp.c:972
0xf865a7 ix86_function_arg_advance
        ../../gcc-trunk/gcc/config/i386/i386.c:7786
0xa244cb gimplify_parameters()
        ../../gcc-trunk/gcc/function.c:4086
0xa81757 gimplify_body(tree_node*, bool)
        ../../gcc-trunk/gcc/gimplify.c:9199
0xa81af6 gimplify_function_tree(tree_node*)
        ../../gcc-trunk/gcc/gimplify.c:9361
0x900337 cgraph_node::analyze()
        ../../gcc-trunk/gcc/cgraphunit.c:636
0x90351b analyze_functions
        ../../gcc-trunk/gcc/cgraphunit.c:1028
0x9040a8 symbol_table::finalize_compilation_unit()
        ../../gcc-trunk/gcc/cgraphunit.c:2477
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ 


---------------


struct S
{
  S f;
};

void
fn1 (S p1)
{
}

Reply via email to