PR middle-end/97956 - ICE due to type mismatch in pointer_plus_expr during memchr...
authorMartin Sebor <msebor@redhat.com>
Wed, 25 Nov 2020 18:00:10 +0000 (11:00 -0700)
committerMartin Sebor <msebor@redhat.com>
Wed, 25 Nov 2020 18:02:11 +0000 (11:02 -0700)
commitaec2d6849160f92cd45f97d6c3bdd8808ab01fa6
treef1d8ab6cc86952b36119f027b0b9342bd70c5554
parent9d908b7fc475b351622fa5630d4874068c789d70
PR middle-end/97956 - ICE due to type mismatch in pointer_plus_expr during memchr folding

gcc/ChangeLog:

PR middle-end/97956
* gimple-fold.c (gimple_fold_builtin_memchr): Use sizetype for pointer
offsets.

gcc/testsuite/ChangeLog:

PR middle-end/97956
* gcc.dg/memchr-3.c: New test.
gcc/gimple-fold.c
gcc/testsuite/gcc.dg/memchr-3.c [new file with mode: 0644]