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

            Bug ID: 117748
           Summary: ICE: tree check: expected class ‘type’, have
                    ‘exceptional’ (error_mark) in create_tmp_from_val, at
                    gimplify.cc:592
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xieym3 at zohomail dot com
  Target Milestone: ---

$ cat 20241123025220_10.c
char foo ( char * x )
{
return * x ;
}
void bar ( char * x )
{
void * x [ foo ( x ) ] __attribute__ ( ( unused ) ) ;
}
void baz ( char * x )
{
bar ( x ) ;
}
$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=/data/xieym/exp/gcc/test_data/gcc-latest-install/bin/gcc
COLLECT_LTO_WRAPPER=/data/xieym/exp/gcc/test_data/gcc-latest-install/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /data/xieym/exp/gcc/test_data/gcc-latest-src/configure
--enable-coverage --enable-checking --disable-multilib --disable-shared
--disable-bootstrap --enable-languages=c,c++
--prefix=/data/xieym/exp/gcc/test_data/gcc-latest-install
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20241123 (experimental) (GCC)
$ gcc-trunk -x c -std=c2x -c 20241123025220_10.c -o /dev/null
20241123025220_10.c: In function ‘bar’:
20241123025220_10.c:7:8: error: ‘x’ redeclared as different kind of symbol
    7 | void * x [ foo ( x ) ] __attribute__ ( ( unused ) ) ;
      |        ^
20241123025220_10.c:5:19: note: previous definition of ‘x’ with type ‘char *’
    5 | void bar ( char * x )
      |            ~~~~~~~^
20241123025220_10.c:7:1: internal compiler error: tree check: expected class
‘type’, have ‘exceptional’ (error_mark) in create_tmp_from_val, at
gimplify.cc:592
    7 | void * x [ foo ( x ) ] __attribute__ ( ( unused ) ) ;
      | ^~~~
0x567214e internal_error(char const*, ...)
       
/data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/diagnostic-global-context.cc:517
0x27bd5cd tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/tree.cc:9081
0xe09b06 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/tree.h:3817
0x17a5482 create_tmp_from_val
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:592
0x17a561b lookup_tmp_var
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:615
0x17a5b9f internal_get_tmp_var
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:670
0x17a6017 get_initialized_tmp_var(tree_node*, gimple**, gimple**, bool)
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:714
0x17cdc85 gimplify_save_expr
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:7066
0x182ac64 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:18957
0x17d2b23 gimplify_stmt(tree_node**, gimple**)
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:7839
0x17b01c1 gimplify_statement_list
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:2256
0x182c0de gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:19107
0x17d2b23 gimplify_stmt(tree_node**, gimple**)
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:7839
0x17ac306 gimplify_bind_expr
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:1651
0x182a286 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:18857
0x17d2b23 gimplify_stmt(tree_node**, gimple**)
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:7839
0x1831208 gimplify_body(tree_node*, bool)
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:19945
0x18323e7 gimplify_function_tree(tree_node*)
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:20146
0x133bf2a cgraph_node::analyze()
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/cgraphunit.cc:687
0x133fe1a analyze_functions
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/cgraphunit.cc:1251
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