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

            Bug ID: 117757
           Summary: ICE: tree check: expected class ‘type’, have
                    ‘exceptional’ (error_mark) in c_gimplify_expr, at
                    c-family/c-gimplify.cc:810
           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 1.c
int c;
int d() {
  int d = 1;
  int h = 0;
  int i = (int)c << h;
  static int h[4][4][4][4][4][4][4] __attribute__((__aligned__(1L)));
}
$ 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 1.c -o /dev/null
1.c: In function ‘d’:
1.c:6:14: error: conflicting types for ‘h’; have ‘int[4][4][4][4][4][4][4]’
    6 |   static int h[4][4][4][4][4][4][4] __attribute__((__aligned__(1L)));
      |              ^
1.c:4:7: note: previous definition of ‘h’ with type ‘int’
    4 |   int h = 0;
      |       ^
1.c:5:18: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in c_gimplify_expr, at c-family/c-gimplify.cc:810
    5 |   int i = (int)c << h;
      |           ~~~~~~~^~~~
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
0x10bd114 c_gimplify_expr(tree_node**, gimple**, gimple**)
       
/data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/c-family/c-gimplify.cc:810
0x1828595 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:18562
0x17cb0c3 gimplify_modify_expr
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:6717
0x1828c6a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:18656
0x17d2b23 gimplify_stmt(tree_node**, gimple**)
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:7839
0x17a4f8a gimplify_and_add(tree_node*, gimple**)
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:518
0x17afc1a gimplify_decl_expr
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:2173
0x182a23d gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /data/xieym/exp/gcc/test_data/gcc-latest-src/gcc/gimplify.cc:18853
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
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