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

--- Comment #5 from Dmitry G. Dyachenko <dimhen at gmail dot com> ---
$ cat x.i
typedef enum { a } b;
typedef struct {
  int c[0];
} d;
typedef struct {
  int *data;
} e;
typedef struct {
  e buffer;
} f;
int g, h;
int i();
int i(f *j, d *k, b l, int m) {
  if (l)
    if (m) {
      h = j->buffer.data[0];
      k->c[g] = k->c[g] * 8;
    }
  return 0;


$ gcc -fpreprocessed -O2 -fsanitize=thread -c x.i
during GIMPLE pass: strlen
x.i: In function ā€˜iā€™:
x.i:13:5: internal compiler error: in fold_binary_loc, at fold-const.c:9827
   13 | int i(f *j, d *k, b l, int m) {
      |     ^
0x667691 fold_binary_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        /home/dimhen/src/gcc_current/gcc/fold-const.c:9827
0xcc9bed fold_build2_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        /home/dimhen/src/gcc_current/gcc/fold-const.c:12338
0x11b4a62 get_stridx
        /home/dimhen/src/gcc_current/gcc/tree-ssa-strlen.c:327
0x11b4a62 get_stridx
        /home/dimhen/src/gcc_current/gcc/tree-ssa-strlen.c:293
0x11bb65c strlen_check_and_optimize_stmt
        /home/dimhen/src/gcc_current/gcc/tree-ssa-strlen.c:3721
0x11bb65c strlen_dom_walker::before_dom_children(basic_block_def*)
        /home/dimhen/src/gcc_current/gcc/tree-ssa-strlen.c:4009
0x18dfca2 dom_walker::walk(basic_block_def*)
        /home/dimhen/src/gcc_current/gcc/domwalk.c:312
0x11b0ea0 execute
        /home/dimhen/src/gcc_current/gcc/tree-ssa-strlen.c:4089
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Reply via email to