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

            Bug ID: 113817
           Summary: ice in move_early_exit_stmts
           Product: gcc
           Version: 14.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 code:

char enc_int_dst_orig;
long main_val;
char main_buf[20];
char *enc_int(char *dst, char *end, long value) {
  while (value)
    if (dst < end)
      *dst++ = value >>= 7;
    else
      return &enc_int_dst_orig;
  *dst = 7;
}
void main() { enc_int(main_buf, main_buf + sizeof(main_buf), main_val); }

compiles ok as follows:

$ /home/dcb38/gcc/results.20240202.asan.ubsan/bin/gcc -c -O3 -march=znver3
~/cvise/bug1005.c
$

But a few days later:

$ /home/dcb38/gcc/results.20240205.asan.ubsan/bin/gcc -c -O3 -march=znver3
~/cvise/bug1005.c
during GIMPLE pass: vect
/home/dcb38/cvise/bug1005.c: In function ‘main’:
/home/dcb38/cvise/bug1005.c:12:6: internal compiler error: Segmentation fault
   12 | void main() { enc_int(main_buf, main_buf + sizeof(main_buf), main_val); 
}
      |      ^~~~
0xed44e9 crash_signal(int)
        /home/dcb38/gcc/working/gcc/../../trunk.20210101/gcc/toplev.cc:317
0x1186bd3 gsi_prev(gimple_stmt_iterator*)
        ../../trunk.20210101/gcc/gimple-iterator.h:236
0x1186bd3 move_early_exit_stmts(_loop_vec_info*)
       
/home/dcb38/gcc/working/gcc/../../trunk.20210101/gcc/tree-vect-loop.cc:1
1804

$ /home/dcb38/gcc/results.20240202.asan.ubsan/bin/gcc -v 2>&1 | grep exp
gcc version 14.0.1 20240202 (experimental) (639bd5e9b759a6d7)
$ /home/dcb38/gcc/results.20240205.asan.ubsan/bin/gcc -v 2>&1 | grep exp
gcc version 14.0.1 20240205 (experimental) (5b281946c4b51132)

The git range is 40 commits.

Reply via email to