public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "141242068 at smail dot nju.edu.cn" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/110699] New: internal compiler error: tree check: expected array_type, have error_mark in array_ref_low_bound, at tree.cc:12754
Date: Mon, 17 Jul 2023 09:14:31 +0000	[thread overview]
Message-ID: <bug-110699-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 110699
           Summary: internal compiler error: tree check: expected
                    array_type, have error_mark in array_ref_low_bound, at
                    tree.cc:12754
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: 141242068 at smail dot nju.edu.cn
  Target Milestone: ---

When compiling below program using gcc-14 with option `gcc-14 a.c`, gcc-14
crashes:
```
typedef __attribute__((__vector_size__(64))) int T;

void f(void) {
  extern char a[64], b[64];
  void *p = a;
  T q = *(T *)&b[0];
}

void g() {
  extern char b;
}
```

GCC's output is pasted below:
```
<source>: In function 'g':
<source>:10:15: error: conflicting types for 'b'; have 'char'
   10 |   extern char b;
      |               ^
<source>:4:22: note: previous declaration of 'b' with type 'char[64]'
    4 |   extern char a[64], b[64];
      |                      ^
<source>: In function 'f':
<source>:6:17: internal compiler error: tree check: expected array_type, have
error_mark in array_ref_low_bound, at tree.cc:12754
    6 |   T q = *(T *)&b[0];
      |                ~^~~
0x215104e internal_error(char const*, ...)
        ???:0
0x896b1b tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ???:0
0xd6c895 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xd6d557 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xd6db1d gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xd6cf6a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xd7053a gimplify_stmt(tree_node**, gimple**)
        ???:0
0xd6d53e gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xd7053a gimplify_stmt(tree_node**, gimple**)
        ???:0
0xd6e4ab gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xd7053a gimplify_stmt(tree_node**, gimple**)
        ???:0
0xd6d914 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xd7053a gimplify_stmt(tree_node**, gimple**)
        ???:0
0xd719d3 gimplify_body(tree_node*, bool)
        ???:0
0xd71e2f gimplify_function_tree(tree_node*)
        ???:0
0xbaeba7 cgraph_node::analyze()
        ???:0
0xbb26f1 symbol_table::finalize_compilation_unit()
        ???:0
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.
```

This can be verified by visiting the Compiler Explorer:
https://gcc.godbolt.org/z/jPhnfG4f3

             reply	other threads:[~2023-07-17  9:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17  9:14 141242068 at smail dot nju.edu.cn [this message]
2023-07-17 14:24 ` [Bug c/110699] [12/13/14 Regression] " mpolacek at gcc dot gnu.org
2023-07-17 14:26 ` mpolacek at gcc dot gnu.org
2023-07-17 18:13 ` pinskia at gcc dot gnu.org
2023-07-21 19:40 ` cvs-commit at gcc dot gnu.org
2023-07-23 12:49 ` roger at nextmovesoftware dot com
2023-07-23 17:55 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-110699-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).