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

            Bug ID: 84304
           Summary: tree check fail in to_wide, at tree.h:5527
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

For this C source code:

a, b;
c() {
  char d[b];
  char *e = &d[0];
  strncpy(a, e, 3);
}

with flag -O2, recent gcc trunk does this:

bug417.c:2:1: internal compiler error: tree check: expected integer_cst, have
pl
us_expr in to_wide, at tree.h:5527
 c() {
 ^
0x59606c tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../trunk/gcc/tree.c:9325
0x6f9a88 tree_check(tree_node const*, char const*, int, char const*, tree_code)
        ../../trunk/gcc/tree.h:3388
0x6f9a88 wi::to_wide(tree_node const*)
        ../../trunk/gcc/tree.h:5527
0x6f9a88 wi::to_wide(tree_node const*, unsigned int)
        ../../trunk/gcc/tree.h:5538

I'll have a go at finding a range of revisions for the bug.

Reply via email to