This is the mail archive of the
mailing list for the GCC project.
Re: [PING] [PATCH] Fix wrong code with truncated string literals (PR 86711/86714)
- From: Martin Sebor <msebor at gmail dot com>
- To: Bernd Edlinger <bernd dot edlinger at hotmail dot de>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Richard Biener <rguenther at suse dot de>, Jeff Law <law at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>
- Date: Mon, 13 Aug 2018 08:27:15 -0600
- Subject: Re: [PING] [PATCH] Fix wrong code with truncated string literals (PR 86711/86714)
- References: <DB6PR0701MB266438272BCFD277C6600399E4280@DB6PR0701MB2664.eurprd07.prod.outlook.com> <AM5PR0701MB2657AC0E7017E34BAD499B66E43A0@AM5PR0701MB2657.eurprd07.prod.outlook.com>
As I said below, the patch for PR 86552, 86711, 86714 that
was first posted on July 19 fixes both of these issues and
also diagnoses calls with unterminated strings:
On 08/12/2018 03:06 AM, Bernd Edlinger wrote:
I'd like to ping for this patch: https://gcc.gnu.org/ml/gcc-patches/2018-07/msg01800.html
I will add a new BZ entry for the (minor) regression this patch
introduces in gcc.dg/strlenopt-49.c and assign it to myself.
On 07/29/18 12:56, Bernd Edlinger wrote:
This fixes two wrong code bugs where string_constant
returns over length string constants. Initializers
like that are rejected in C++, but valid in C.
I have xfailed strlenopt-49.c, which tests this feature.
Personally I don't think that it is worth the effort to
optimize something that is per se invalid in C++.
The hunk in builtins.c is unrelated, but I would like
to use tree_to_shwi here, to be in line with the
tree_fits_shwi_p check above, and the rest of that
function which uses signed HWI throughout.
Bootstrapped and reg-tested on x86_64-pc-linux-gnu.
Is it OK for trunk?