This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Check the STRING_CSTs in varasm.c
- From: Jeff Law <law at redhat dot com>
- To: Bernd Edlinger <bernd dot edlinger at hotmail dot de>, Martin Sebor <msebor at gmail dot com>, Richard Biener <rguenther at suse dot de>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 13 Sep 2018 14:43:21 -0600
- Subject: Re: [PATCH] Check the STRING_CSTs in varasm.c
- References: <AM5PR0701MB265742C278E7D1859AF10E59E42D0@AM5PR0701MB2657.eurprd07.prod.outlook.com> <AM5PR0701MB2657F69614869A154DE4F63AE4220@AM5PR0701MB2657.eurprd07.prod.outlook.com> <alpine.LSU.2.20.1808171137250.16707@zhemvz.fhfr.qr> <AM5PR0701MB2657496F56A49202C9930B90E43D0@AM5PR0701MB2657.eurprd07.prod.outlook.com> <alpine.LSU.2.20.1808171415270.16707@zhemvz.fhfr.qr> <AM5PR0701MB2657134391AA894E44F8C9A2E43D0@AM5PR0701MB2657.eurprd07.prod.outlook.com> <alpine.LSU.2.20.1808171529380.16707@zhemvz.fhfr.qr> <AM5PR0701MB26571C9E2DEF1989FB502EF5E43D0@AM5PR0701MB2657.eurprd07.prod.outlook.com> <AM5PR0701MB26577C89D431A8965ECBC3E6E4300@AM5PR0701MB2657.eurprd07.prod.outlook.com> <3c743954-cae6-a7b8-3c63-71d170d8e56c@gmail.com> <AM5PR0701MB26571BE317560A1914A6AD35E4360@AM5PR0701MB2657.eurprd07.prod.outlook.com> <2f4995e8-b081-54be-54ba-34e6e15effeb@redhat.com> <VI1PR0701MB28627E8ED583BDBA6BAB0185E41A0@VI1PR0701MB2862.eurprd07.prod.outlook.com>
On 9/13/18 1:41 PM, Bernd Edlinger wrote:
> On 09/13/18 20:44, Jeff Law wrote:
>> On 8/24/18 2:18 PM, Bernd Edlinger wrote:
>>> Hi!
>>>
>>>
>>> This is an alternative approach in making STRING_CST semantics
>>> consistent.
>>>
>>> This means it makes STRING_CST used for literals and for initializers
>>> use exactly the same semantics.
>>>
>>> It makes sure that all STRING_CST have a TYPE_SIZE_UNIT, and that it is
>>> always larger than TREE_STRING_LENGTH, these and certain other properties
>>> are checked in varasm.c, so the currently observed consistency issues
>>> in the middle-end can be resolved.
>>>
>>>
>>> It depends on the following pre-condition patches:
>> [ ... ]
>>
>>>
>>> [PATCHv2] Handle overlength strings in C++ FE
>>> https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01567.html
>> I've committed this patch to the trunk.
>>
>
> Note, however this leaves pr87503.c semi-broken:
>
> gcc -fpermissive -x c++ -O2 pr87053.c
> pr87053.c:11:23: warning: initializer-string for array of chars is too long [-fpermissive]
> 11 | } u = {{"1234", "567"}};
> | ^
> $ ./a.out
> Aborted (core dumped)
>
>
> This would be fixed by the patch I posted earlier today:
>
> https://gcc.gnu.org/ml/gcc-patches/2018-09/msg00690.html
I'm not done for the day :-)
jeff