public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/109598] New: ICE: tree check: expected array_type, have error_mark in array_ref_low_bound, at tree.cc
@ 2023-04-23  2:56 anbu1024.me at gmail dot com
  2023-04-24  7:12 ` [Bug c/109598] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: anbu1024.me at gmail dot com @ 2023-04-23  2:56 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109598
           Summary: ICE: tree check: expected array_type, have error_mark
                    in array_ref_low_bound, at tree.cc
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

gcc (GCC) 13.0.1 20230219 snapshot ICEs when compiling the following testcase

$ gcc --version
gcc (GCC) 13.0.1 20230219 (experimental)
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

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

$ cat 2.c

extern char g[];

char *foo(void)
{
  return &g[0];
}

char *g(void)
{
  return &g[1];
}

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

$ gcc 2.c 
2.c:9:7: error: ‘g’ redeclared as different kind of symbol
    9 | char *g(void)
      |       ^
2.c:2:13: note: previous declaration of ‘g’ with type ‘char[]’
    2 | extern char g[];
      |             ^
2.c: In function ‘g’:
2.c:11:12: error: subscripted value is neither array nor pointer nor vector
   11 |   return &g[1];
      |            ^
2.c: In function ‘foo’:
2.c:6:12: internal compiler error: tree check: expected array_type, have
error_mark in array_ref_low_bound, at tree.cc:12782
    6 |   return &g[0];
      |           ~^~~
0x840178 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc-13-20230219/gcc/tree.cc:8909
0x8499ae tree_check(tree_node*, char const*, int, char const*, tree_code)
        ../../gcc-13-20230219/gcc/tree.h:3530
0x8499ae array_ref_low_bound(tree_node*)
        ../../gcc-13-20230219/gcc/tree.cc:12782
0xc8caf9 gimplify_compound_lval
        ../../gcc-13-20230219/gcc/gimplify.cc:3219
0xc875fe gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-13-20230219/gcc/gimplify.cc:16313
0xc8e602 gimplify_addr_expr
        ../../gcc-13-20230219/gcc/gimplify.cc:6561
0xc8805d gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-13-20230219/gcc/gimplify.cc:16408
0xc9a465 gimplify_modify_expr
        ../../gcc-13-20230219/gcc/gimplify.cc:6153
0xc879e1 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-13-20230219/gcc/gimplify.cc:16361
0xc8a316 gimplify_stmt(tree_node**, gimple**)
        ../../gcc-13-20230219/gcc/gimplify.cc:7219
0xc96670 gimplify_and_add(tree_node*, gimple**)
        ../../gcc-13-20230219/gcc/gimplify.cc:492
0xc96670 gimplify_return_expr
        ../../gcc-13-20230219/gcc/gimplify.cc:1680
0xc87d0a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-13-20230219/gcc/gimplify.cc:16623
0xc8a316 gimplify_stmt(tree_node**, gimple**)
        ../../gcc-13-20230219/gcc/gimplify.cc:7219
0xc8aa47 gimplify_bind_expr
        ../../gcc-13-20230219/gcc/gimplify.cc:1430
0xc87c95 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-13-20230219/gcc/gimplify.cc:16562
0xca912e gimplify_stmt(tree_node**, gimple**)
        ../../gcc-13-20230219/gcc/gimplify.cc:7219
0xca912e gimplify_body(tree_node*, bool)
        ../../gcc-13-20230219/gcc/gimplify.cc:17623
0xca958a gimplify_function_tree(tree_node*)
        ../../gcc-13-20230219/gcc/gimplify.cc:17822
0xad7fa7 cgraph_node::analyze()
        ../../gcc-13-20230219/gcc/cgraphunit.cc:676
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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-23 12:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-23  2:56 [Bug c/109598] New: ICE: tree check: expected array_type, have error_mark in array_ref_low_bound, at tree.cc anbu1024.me at gmail dot com
2023-04-24  7:12 ` [Bug c/109598] " rguenth at gcc dot gnu.org
2023-04-24  9:50 ` marxin at gcc dot gnu.org
2023-04-24 18:19 ` [Bug c/109598] [12/13/14 Regression] " pinskia at gcc dot gnu.org
2023-07-23 12:50 ` roger at nextmovesoftware dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).