tree-optimization/107554 - fix ICE in stlen optimization
authorRichard Biener <rguenther@suse.de>
Fri, 11 Nov 2022 13:28:52 +0000 (14:28 +0100)
committerRichard Biener <rguenther@suse.de>
Fri, 11 Nov 2022 14:04:53 +0000 (15:04 +0100)
commit81de4037454275f8ed6d858fbc129e832c6147ef
treeb8d2b0686636bd309172205de1d9ff31cd3a5d03
parent4b3874d803e7961f38b22fa798517a63171bb985
tree-optimization/107554 - fix ICE in stlen optimization

The following fixes a wrongly typed variable causing an ICE.

PR tree-optimization/107554
* tree-ssa-strlen.cc (strlen_pass::count_nonzero_bytes):
Use unsigned HOST_WIDE_INT type for the strlen.

* gcc.dg/pr107554.c: New testcase.

Co-Authored-By: Nikita Voronov <nik_1357@mail.ru>
gcc/testsuite/gcc.dg/pr107554.c [new file with mode: 0644]
gcc/tree-ssa-strlen.cc