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

            Bug ID: 90872
           Summary: [8 regression] ICE on invalid in
                    contains_struct_check()
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dimhen at gmail dot com
  Target Milestone: ---

r267346 PASS
r267961 FAIL
r272203 FAIL

$ cat x.i
a() {
  void b() = ;
  b == 0
$ /usr/local/gcc_current/bin/gcc -fpreprocessed -c x.i
x.i:1:1: warning: return type defaults to 'int' [-Wimplicit-int]
    1 | a() {
      | ^
x.i: In function 'a':
x.i:2:3: error: function 'b' is initialized like a variable
    2 |   void b() = ;
      |   ^~~~
x.i:2:14: error: expected expression before ';' token
    2 |   void b() = ;
      |              ^
x.i:3:9: error: expected ';' at end of input
    3 |   b == 0
      |         ^
      |         ;
x.i:3:3: error: expected declaration or statement at end of input
    3 |   b == 0
      |   ^
x.i:1:1: internal compiler error: Segmentation fault
    1 | a() {
      | ^
0xfeddbf crash_signal
        /home/dimhen/src/gcc_current/gcc/toplev.c:326
0xd3aee7 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
        /home/dimhen/src/gcc_current/gcc/tree.h:3310
0xd3aee7 unshare_body
        /home/dimhen/src/gcc_current/gcc/gimplify.c:933
0xd3af82 unshare_body
        /home/dimhen/src/gcc_current/gcc/gimplify.c:940
0xd47262 gimplify_body(tree_node*, bool)
        /home/dimhen/src/gcc_current/gcc/gimplify.c:13902
0xd47697 gimplify_function_tree(tree_node*)
        /home/dimhen/src/gcc_current/gcc/gimplify.c:14058
0xb9ea77 cgraph_node::analyze()
        /home/dimhen/src/gcc_current/gcc/cgraphunit.c:667
0xba180d analyze_functions
        /home/dimhen/src/gcc_current/gcc/cgraphunit.c:1126
0xba2462 symbol_table::finalize_compilation_unit()
        /home/dimhen/src/gcc_current/gcc/cgraphunit.c:2833
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.
$ /usr/local/gcc_current/bin/gcc -v                   
Using built-in specs.
COLLECT_GCC=/usr/local/gcc_current/bin/gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/10.0.0/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/usr/local/gcc_current --enable-checking=yes,df,fold,rtl,extra
--enable-languages=c,c++,lto --disable-multilib --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin
--enable-initfini-array --with-isl --enable-offload-targets=nvptx-none
--without-cuda-driver --enable-gnu-indirect-function --with-tune=native
Thread model: posix
gcc version 10.0.0 20190612 (experimental) [trunk revision 272203] (GCC)

Reply via email to