Re: [PATCH] Handle '\0' in strcmp in RTL expansion (PR tree-optimization/90892).

2019-07-02 Thread Jeff Law
00 2001 > From: Martin Liska > Date: Mon, 17 Jun 2019 10:39:15 +0200 > Subject: [PATCH] Handle '\0' in strcmp in RTL expansion (PR > tree-optimization/90892). > > gcc/ChangeLog: > > 2019-06-17 Martin Liska > > PR tree-optimization/90892 > *

Re: [PATCH] Handle '\0' in strcmp in RTL expansion (PR tree-optimization/90892).

2019-06-27 Thread Martin Liška
n testing the patch. Ready to be installed then? Thanks, Martin >From 35043ab431c0dc1e8dcda484725a1f8875a4b95b Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 17 Jun 2019 10:39:15 +0200 Subject: [PATCH] Handle '\0' in strcmp in RTL expansion (PR tree-optimization/90892). gcc/ChangeLog:

Re: [PATCH] Handle '\0' in strcmp in RTL expansion (PR tree-optimization/90892).

2019-06-20 Thread Martin Liška
On 6/18/19 11:56 AM, Martin Liška wrote: > On 6/18/19 10:23 AM, Martin Liška wrote: >> On 6/18/19 10:11 AM, Jakub Jelinek wrote: >>> On Tue, Jun 18, 2019 at 10:07:50AM +0200, Martin Liška wrote: diff --git a/gcc/builtins.c b/gcc/builtins.c index 3463ffb1539..b58e1e58d4d 100644 ---

Re: [PATCH] Handle '\0' in strcmp in RTL expansion (PR tree-optimization/90892).

2019-06-18 Thread Martin Liška
On 6/18/19 12:33 PM, Jakub Jelinek wrote: > On Tue, Jun 18, 2019 at 12:27:31PM +0200, Martin Liška wrote: >>> Oops. The problematic case is then if the STRING_CST c_getstr finds >>> is not NUL terminated (dunno if we ever construct that) or if >>> string_size is smaller than string_length and

Re: [PATCH] Handle '\0' in strcmp in RTL expansion (PR tree-optimization/90892).

2019-06-18 Thread Jakub Jelinek
On Tue, Jun 18, 2019 at 12:27:31PM +0200, Martin Liška wrote: > > Oops. The problematic case is then if the STRING_CST c_getstr finds > > is not NUL terminated (dunno if we ever construct that) or if > > string_size is smaller than string_length and there are no NULs in that > > size. > > The

Re: [PATCH] Handle '\0' in strcmp in RTL expansion (PR tree-optimization/90892).

2019-06-18 Thread Martin Liška
gt;> >>> Martin >>> >> >> Ok, there's an off-by-one error in the previous patch candidate. >> Patch can bootstrap on x86_64-linux-gnu and survives regression tests. >> >> Ready to be installed? >> Thanks, >> Martin > >> >

Re: [PATCH] Handle '\0' in strcmp in RTL expansion (PR tree-optimization/90892).

2019-06-18 Thread Jakub Jelinek
1 != NULL) > >> len1 = strnlen (src_str1, len1); > >> > >>Jakub > >> > > > > Got it, I'm testing that. > > > > Martin > > > > Ok, there's an off-by-one error in the previous patch candidate. > Patch can boots

Re: [PATCH] Handle '\0' in strcmp in RTL expansion (PR tree-optimization/90892).

2019-06-18 Thread Martin Liška
. > > Martin > Ok, there's an off-by-one error in the previous patch candidate. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin >From fe4ef7d43c506f450de802a7d8a602fab7da4545 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 17 Jun 2019 10:39:15 +02

Re: [PATCH] Handle '\0' in strcmp in RTL expansion (PR tree-optimization/90892).

2019-06-18 Thread Martin Liška
; if (src_str1 != NULL) > len1 = strnlen (src_str1, len1); > > Jakub > Got it, I'm testing that. Martin >From 5450be93ace37d93e700cb077aebe628a9fe0a0e Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 17 Jun 2019 10:39:15 +0200 Subject: [PATCH] Handle '\0' in strcmp

Re: [PATCH] Handle '\0' in strcmp in RTL expansion (PR tree-optimization/90892).

2019-06-18 Thread Jakub Jelinek
On Tue, Jun 18, 2019 at 10:07:50AM +0200, Martin Liška wrote: > diff --git a/gcc/builtins.c b/gcc/builtins.c > index 3463ffb1539..b58e1e58d4d 100644 > --- a/gcc/builtins.c > +++ b/gcc/builtins.c > @@ -7142,6 +7142,20 @@ inline_expand_builtin_string_cmp (tree exp, rtx target) >const char

Re: [PATCH] Handle '\0' in strcmp in RTL expansion (PR tree-optimization/90892).

2019-06-18 Thread Martin Liška
nux-gnu and survives regression tests. Ready to be installed? Thanks, Martin > > Jakub > >From d3bb4fc58dc92057bdb3e0921d6c0ffce1e8d732 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 17 Jun 2019 10:39:15 +0200 Subject: [PATCH] Handle '\0' in strcmp in RTL expansion

Re: [PATCH] Handle '\0' in strcmp in RTL expansion (PR tree-optimization/90892).

2019-06-17 Thread Jakub Jelinek
On Mon, Jun 17, 2019 at 11:26:03AM +0200, Martin Liška wrote: > diff --git a/gcc/builtins.c b/gcc/builtins.c > index 3463ffb1539..917852071b9 100644 > --- a/gcc/builtins.c > +++ b/gcc/builtins.c > @@ -7142,6 +7142,20 @@ inline_expand_builtin_string_cmp (tree exp, rtx target) >const char

[PATCH] Handle '\0' in strcmp in RTL expansion (PR tree-optimization/90892).

2019-06-17 Thread Martin Liška
Hi. The function c_getstr returns string and length of the string. In inline_expand_builtin_string_cmp, we should consider situations where a string constant contains a zero character. In that case we have to shorten len[12]. Patch can bootstrap on x86_64-linux-gnu and survives regression tests.