Re: [PATCH] Convert character arrays to string csts

2017-08-14 Thread Richard Biener
On Mon, Aug 14, 2017 at 1:25 PM, Richard Biener wrote: > On Mon, Aug 14, 2017 at 1:23 PM, Richard Biener > wrote: >> On Wed, Aug 9, 2017 at 1:39 PM, Martin Liška wrote: >>> On 08/09/2017 11:43 AM, Richard Biener wrote: I only have the patch I sent you so I can't re-diff. Richard.

Re: [PATCH] Convert character arrays to string csts

2017-08-14 Thread Richard Biener
On Mon, Aug 14, 2017 at 1:23 PM, Richard Biener wrote: > On Wed, Aug 9, 2017 at 1:39 PM, Martin Liška wrote: >> On 08/09/2017 11:43 AM, Richard Biener wrote: >>> I only have the patch I sent you so I can't re-diff. >>> >>> Richard. >> >> Hi. >> >> I'm sending rebased version of the patch. However

Re: [PATCH] Convert character arrays to string csts

2017-08-14 Thread Richard Biener
On Wed, Aug 9, 2017 at 1:39 PM, Martin Liška wrote: > On 08/09/2017 11:43 AM, Richard Biener wrote: >> I only have the patch I sent you so I can't re-diff. >> >> Richard. > > Hi. > > I'm sending rebased version of the patch. However the patch > eats all my memory when e.g. building ../../../libgcc

Re: [PATCH] Convert character arrays to string csts

2017-08-09 Thread Martin Liška
On 08/09/2017 11:43 AM, Richard Biener wrote: > I only have the patch I sent you so I can't re-diff. > > Richard. Hi. I'm sending rebased version of the patch. However the patch eats all my memory when e.g. building ../../../libgcc/libgcov-merge.c. If you have time, please try to make it working

Re: [PATCH] Convert character arrays to string csts

2017-08-09 Thread Richard Biener
On August 9, 2017 11:15:44 AM GMT+02:00, "Martin Liška" wrote: >On 08/08/2017 03:18 PM, Richard Biener wrote: >> On Tue, Aug 8, 2017 at 1:47 PM, Martin Liška wrote: >>> On 11/09/2016 11:22 AM, Richard Biener wrote: On Fri, Nov 4, 2016 at 2:33 PM, Martin Liška >wrote: > On 11/03/2016 02:

Re: [PATCH] Convert character arrays to string csts

2017-08-09 Thread Martin Liška
On 08/08/2017 03:18 PM, Richard Biener wrote: > On Tue, Aug 8, 2017 at 1:47 PM, Martin Liška wrote: >> On 11/09/2016 11:22 AM, Richard Biener wrote: >>> On Fri, Nov 4, 2016 at 2:33 PM, Martin Liška wrote: On 11/03/2016 02:00 PM, Jan Hubicka wrote: >> On 11/03/2016 01:12 PM, Martin Liška

Re: [PATCH] Convert character arrays to string csts

2017-08-08 Thread Richard Biener
On Tue, Aug 8, 2017 at 1:47 PM, Martin Liška wrote: > On 11/09/2016 11:22 AM, Richard Biener wrote: >> On Fri, Nov 4, 2016 at 2:33 PM, Martin Liška wrote: >>> On 11/03/2016 02:00 PM, Jan Hubicka wrote: > On 11/03/2016 01:12 PM, Martin Liška wrote: >> + tree init = DECL_INITIAL (decl); >>

Re: [PATCH] Convert character arrays to string csts

2017-08-08 Thread Martin Liška
On 11/09/2016 11:22 AM, Richard Biener wrote: > On Fri, Nov 4, 2016 at 2:33 PM, Martin Liška wrote: >> On 11/03/2016 02:00 PM, Jan Hubicka wrote: On 11/03/2016 01:12 PM, Martin Liška wrote: > + tree init = DECL_INITIAL (decl); > + if (init > + && TREE_READONLY (decl) >

Re: [PATCH] Convert character arrays to string csts

2016-11-09 Thread Richard Biener
On Fri, Nov 4, 2016 at 2:33 PM, Martin Liška wrote: > On 11/03/2016 02:00 PM, Jan Hubicka wrote: >>> On 11/03/2016 01:12 PM, Martin Liška wrote: + tree init = DECL_INITIAL (decl); + if (init + && TREE_READONLY (decl) + && can_convert_ctor_to_string_cst (init))

Re: [PATCH] Convert character arrays to string csts

2016-11-04 Thread Martin Liška
gt;> + unsigned HOST_WIDE_INT elements = CONSTRUCTOR_NELTS (ctor); >>> + FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (ctor), idx, key, value) >>> +{ >>> + if (key == NULL_TREE >>> + || TREE_CODE (key) != INTEGER_CST >>> + || !tree_f

Re: [PATCH] Convert character arrays to string csts

2016-11-04 Thread Martin Liška
On 11/03/2016 01:46 PM, Richard Biener wrote: > On Thu, Nov 3, 2016 at 1:12 PM, Martin Liška wrote: >> Hello. >> >> This is small follow-up of the patches I sent to string folding. >> The patch transforms character array defined in an initializer to string >> constant: >> >> +const char global[] =

Re: [PATCH] Convert character arrays to string csts

2016-11-03 Thread Jan Hubicka
> On 11/03/2016 01:12 PM, Martin Liška wrote: > >+ tree init = DECL_INITIAL (decl); > >+ if (init > >+ && TREE_READONLY (decl) > >+ && can_convert_ctor_to_string_cst (init)) > >+DECL_INITIAL (decl) = build_string_cst_from_ctor (init); > > I'd merge these two new functions since the

Re: [PATCH] Convert character arrays to string csts

2016-11-03 Thread Bernd Schmidt
On 11/03/2016 01:12 PM, Martin Liška wrote: + tree init = DECL_INITIAL (decl); + if (init + && TREE_READONLY (decl) + && can_convert_ctor_to_string_cst (init)) +DECL_INITIAL (decl) = build_string_cst_from_ctor (init); I'd merge these two new functions since they're only ever cal

Re: [PATCH] Convert character arrays to string csts

2016-11-03 Thread Richard Biener
On Thu, Nov 3, 2016 at 1:12 PM, Martin Liška wrote: > Hello. > > This is small follow-up of the patches I sent to string folding. > The patch transforms character array defined in an initializer to string > constant: > > +const char global[] = {'a', 'b', 'c', 'd', '\0'}; > > Apart from that, it al

[PATCH] Convert character arrays to string csts

2016-11-03 Thread Martin Liška
tring folding of local symbols like: + const char local[] = "abcd"; Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. Martin >From ecd2b614072f55e71896f7f5bf290072b3a4b04c Mon Sep 17 00:00:00 2001 From: marxin Date: Mon, 17 Oct 2016 15:24:46 +0200 Subject: