Re: [PATCH] expr: build string_constant only for a char type

2020-07-28 Thread Martin Liška
On 7/28/20 9:00 AM, Richard Biener via Gcc-patches wrote: On Mon, Jul 27, 2020 at 10:49 PM Jakub Jelinek via Gcc-patches wrote: On Mon, Jul 27, 2020 at 09:53:31AM -0600, Martin Sebor via Gcc-patches wrote: Return a pointer P to a NUL-terminated string containing the sequence of bytes co

Re: [PATCH] expr: build string_constant only for a char type

2020-07-28 Thread Richard Biener via Gcc-patches
On Mon, Jul 27, 2020 at 10:49 PM Jakub Jelinek via Gcc-patches wrote: > > On Mon, Jul 27, 2020 at 09:53:31AM -0600, Martin Sebor via Gcc-patches wrote: > > Return a pointer P to a NUL-terminated string containing > > the sequence of bytes corresponding to the representation > > of the object

Re: [PATCH] expr: build string_constant only for a char type

2020-07-27 Thread Jakub Jelinek via Gcc-patches
On Mon, Jul 27, 2020 at 09:53:31AM -0600, Martin Sebor via Gcc-patches wrote: > Return a pointer P to a NUL-terminated string containing > the sequence of bytes corresponding to the representation > of the object referred to by SRC (or a subsequence of such > bytes within it if SRC is a ref

Re: [PATCH] expr: build string_constant only for a char type

2020-07-27 Thread Martin Sebor via Gcc-patches
On 7/27/20 12:54 PM, Martin Liška wrote: On 7/27/20 5:53 PM, Martin Sebor wrote: The tests I committed with the change didn't exercise any of this so that's my bad.  I'm still not sure I understand how the problem with the incomplete type comes up (I haven't had a chance to look into the recent 

Re: [PATCH] expr: build string_constant only for a char type

2020-07-27 Thread Martin Liška
On 7/27/20 5:53 PM, Martin Sebor wrote: The tests I committed with the change didn't exercise any of this so that's my bad.  I'm still not sure I understand how the problem with the incomplete type comes up (I haven't had a chance to look into the recent updates on the bug yet) but to retain the 

Re: [PATCH] expr: build string_constant only for a char type

2020-07-27 Thread Martin Sebor via Gcc-patches
On 7/27/20 6:32 AM, Martin Liška wrote: Hey. As mentioned in the PR, we should not create a string constant for a type that is different from char_type_node. Looking at expr.c, I was inspired and used 'TYPE_MAIN_VARIANT (chartype) == char_type_node' to verify that underlying type is a characte

Re: [PATCH] expr: build string_constant only for a char type

2020-07-27 Thread Jakub Jelinek via Gcc-patches
On Mon, Jul 27, 2020 at 04:12:09PM +0200, Martin Liška wrote: > On 7/27/20 3:16 PM, Jakub Jelinek wrote: > > On Mon, Jul 27, 2020 at 02:32:15PM +0200, Martin Liška wrote: > > > As mentioned in the PR, we should not create a string constant for a type > > > that is different from char_type_node. Loo

Re: [PATCH] expr: build string_constant only for a char type

2020-07-27 Thread Martin Liška
p 17 00:00:00 2001 From: Martin Liska Date: Mon, 27 Jul 2020 12:30:24 +0200 Subject: [PATCH] expr: build string_constant only for a char type gcc/ChangeLog: PR tree-optimization/96058 * expr.c (string_constant): Build string_constant only for a type that has same precision as char_type_node

Re: [PATCH] expr: build string_constant only for a char type

2020-07-27 Thread Jakub Jelinek via Gcc-patches
On Mon, Jul 27, 2020 at 02:32:15PM +0200, Martin Liška wrote: > As mentioned in the PR, we should not create a string constant for a type > that is different from char_type_node. Looking at expr.c, I was inspired > and used 'TYPE_MAIN_VARIANT (chartype) == char_type_node' to verify that > underlyi

[PATCH] expr: build string_constant only for a char type

2020-07-27 Thread Martin Liška
Hey. As mentioned in the PR, we should not create a string constant for a type that is different from char_type_node. Looking at expr.c, I was inspired and used 'TYPE_MAIN_VARIANT (chartype) == char_type_node' to verify that underlying type is a character type. Patch can bootstrap on x86_64-lin