Re: [PATCH] [Ada] Make middle-end string literals NUL terminated

2018-08-09 Thread Olivier Hainque
Hi Bernd, > On 07 Aug 2018, at 19:10, Bernd Edlinger wrote: > >>> procedure Array9 is >>> I see that "1234" is put in the merge section, >>> but V1 is not. Maybe because of the alignment requirement? >>> >>> But it sould not be much different from the C test case, >>> which is now able to

Re: [PATCH] [Ada] Make middle-end string literals NUL terminated

2018-08-07 Thread Bernd Edlinger
On 08/07/18 18:40, Olivier Hainque wrote: > Hi Bernd, > > (Thanks for your interest in the Ada case as well :) > >> On 7 Aug 2018, at 15:07, Bernd Edlinger wrote: > >> When I try this example: >> >> $ cat array9.adb >> -- { dg-do run } >> >> procedure Array9 is >> >>V1 : String(1..10) :=

Re: [PATCH] [Ada] Make middle-end string literals NUL terminated

2018-08-07 Thread Olivier Hainque
Hi Bernd, (Thanks for your interest in the Ada case as well :) > On 7 Aug 2018, at 15:07, Bernd Edlinger wrote: > When I try this example: > > $ cat array9.adb > -- { dg-do run } > > procedure Array9 is > > V1 : String(1..10) := "1234567890"; > V2 : String(1..-1) := ""; > > procedure

Re: [PATCH] [Ada] Make middle-end string literals NUL terminated

2018-08-07 Thread Bernd Edlinger
Hi Olivier, On 08/06/18 20:01, Olivier Hainque wrote: > Hi Bernd, > > Things are moving fast so I'll answer your > messages incrementally :-) > >> On 3 Aug 2018, at 20:37, Bernd Edlinger wrote: > [...] >> Oh, how interesting. >> >> My patch only intends to add a dummy byte that is stripped

Re: [PATCH] [Ada] Make middle-end string literals NUL terminated

2018-08-06 Thread Olivier Hainque
Hi Bernd, Things are moving fast so I'll answer your messages incrementally :-) > On 3 Aug 2018, at 20:37, Bernd Edlinger wrote: [...] > Oh, how interesting. > > My patch only intends to add a dummy byte that is stripped again > in the assembly. The purpose is to make it trivial to find out

Re: [PATCH] [Ada] Make middle-end string literals NUL terminated

2018-08-04 Thread Bernd Edlinger
Hi Olivier, I think I like your idea a lot, it should be highly useful for Fortran and GO as well. Would somthing something like this (untested patch) work for you on top of my patch series. It makes use of the zero-termination properties of STRING_CSTs, that the other patch ensures. I have

Re: [PATCH] [Ada] Make middle-end string literals NUL terminated

2018-08-03 Thread Bernd Edlinger
On 08/03/18 18:50, Olivier Hainque wrote: > Hi Bernd, > >> On 31 Jul 2018, at 14:07, Bernd Edlinger wrote: >> >> Hi! >> >> >> This fixes a couple STRING_CST that are not explicitly NUL terminated. >> These were caught in a new check in varasm.c I am currently working on. >> >> Having a NUL

Re: [PATCH] [Ada] Make middle-end string literals NUL terminated

2018-08-03 Thread Olivier Hainque
Hi Bernd, > On 31 Jul 2018, at 14:07, Bernd Edlinger wrote: > > Hi! > > > This fixes a couple STRING_CST that are not explicitly NUL terminated. > These were caught in a new check in varasm.c I am currently working on. > > Having a NUL terminated string does not change the binary output, but

[PATCH] [Ada] Make middle-end string literals NUL terminated

2018-07-31 Thread Bernd Edlinger
Hi! This fixes a couple STRING_CST that are not explicitly NUL terminated. These were caught in a new check in varasm.c I am currently working on. Having a NUL terminated string does not change the binary output, but it makes things easier for he middle-end. Bootstrapped and reg-tested on