On Tue, Oct 11, 2016 at 11:33 AM, Martin Liška <mli...@suse.cz> wrote:
> Changes from the previous version:
>
> 1) Handle BUILT_IN_STRNCMP with length == -1.
> 2) Direct gimple stmts creation and usage gsi_replace_with_seq_vops.
> (hope using of replace_call_with_value is fine if replacing with a cst?)

yes

> 3) lhs == NULL cases are handled (Or is it fine to replace with a nop in 
> general?
> Can change a semantic as it may touch a memory.)
> 4) CFN_BUILT_IN_STRNCMP can handle strncmp (x, y, 0).
> 5) Handling of CFN_BUILT_IN_STRNCASECMP is added.
>
> Testing of the whole series has been running.

gimple_load_first_char needs a comment.

+      tree var = gimple_load_first_char (loc, str1, &stmts);
+      if (lhs)
+       stmt = gimple_build_assign (lhs, NOP_EXPR, var);
+      else
+       stmt = gimple_build_nop ();

I think you don't need the nop() as you have at least one stmt
from the load.  Likewise for the other cases below.

Otherwise this patch looks ok now.

Richard.



> Martin

Reply via email to