tree-optimization/105786 - avoid strlen replacement for pointers
authorRichard Biener <rguenther@suse.de>
Wed, 1 Jun 2022 12:13:01 +0000 (14:13 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 1 Jun 2022 13:17:42 +0000 (15:17 +0200)
commit57a8fb92ac4161ebbf9381b009e8c5af843e3e5f
tree559ecb64f3bd41383441f26dc15e2f12ce3d0339
parent0d5cc976a36af07c9790c38a99a0b98110c89795
tree-optimization/105786 - avoid strlen replacement for pointers

This avoids matching strlen to a pointer result, avoiding ICEing
because of an integer adjustment using PLUS_EXPR on pointers.

2022-06-01  Richard Biener  <rguenther@suse.de>

PR tree-optimization/105786
* tree-loop-distribution.cc
(loop_distribution::transform_reduction_loop): Only do strlen
replacement for integer type reductions.

* gcc.dg/torture/pr105786.c: New testcase.
gcc/testsuite/gcc.dg/torture/pr105786.c [new file with mode: 0644]
gcc/tree-loop-distribution.cc