Re: [PATCH] Fix up strnlen handling in tree-ssa-strlen.c (PR tree-optimization/89500, take 2)

2019-02-26 Thread Richard Biener
On Tue, 26 Feb 2019, Jakub Jelinek wrote: > On Mon, Feb 25, 2019 at 04:55:56PM -0700, Martin Sebor wrote: > > Storing the strnlen result is intentional when it equals strlen. > > For the *si update, you never want to do that for strnlen. > And for the strlen_to_stridx, while I don't think it is t

[PATCH] Fix up strnlen handling in tree-ssa-strlen.c (PR tree-optimization/89500, take 2)

2019-02-26 Thread Jakub Jelinek
On Mon, Feb 25, 2019 at 04:55:56PM -0700, Martin Sebor wrote: > Storing the strnlen result is intentional when it equals strlen. For the *si update, you never want to do that for strnlen. And for the strlen_to_stridx, while I don't think it is that important, here is an updated patch that handles

Re: [PATCH] Fix up strnlen handling in tree-ssa-strlen.c (PR tree-optimization/89500)

2019-02-25 Thread Martin Sebor
On 2/25/19 4:12 PM, Jakub Jelinek wrote: Hi! The following testcase ICEs, because rhs (previously known string length) is SSA_NAME (return value from the earlier strlen), but bound is 0 and so MIN_EXPR yields also size_zero_node. The noncst_bound initialization checks if new_rhs is INTEGER_CST

[PATCH] Fix up strnlen handling in tree-ssa-strlen.c (PR tree-optimization/89500)

2019-02-25 Thread Jakub Jelinek
Hi! The following testcase ICEs, because rhs (previously known string length) is SSA_NAME (return value from the earlier strlen), but bound is 0 and so MIN_EXPR yields also size_zero_node. The noncst_bound initialization checks if new_rhs is INTEGER_CST and if it is, assumes rhs must be too and u