public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Jeff Law <law@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Patch ping (was Re: [PATCH] Fix ICU miscompilation due to tree-ssa-strlen.c bug (PR tree-optimization/88693))
Date: Fri, 11 Jan 2019 09:52:00 -0000	[thread overview]
Message-ID: <20190111095227.GH30353@tucnak> (raw)
In-Reply-To: <20190104225446.GC30353@tucnak>

On Fri, Jan 04, 2019 at 11:54:46PM +0100, Jakub Jelinek wrote:
> The following patch fixes ICU miscompilation, where an initial part of a
> buffer is initializer from non-zero terminated string literal (in ICU
> actually from an array of non-zero chars that the FE newly turns into
> non-zero terminated string literal), but the code recently added to
> tree-ssa-strlen.c doesn't consider the possibility of string literals that
> aren't zero terminated.
> 
> STRING_CSTs actually are always zero terminated, but if TREE_STRING_LENGTH
> doesn't include the terminating character, it is just bytes.
> 
> Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
> trunk?
> 
> I was considering using strnlen, but if all STRING_CSTs are actually zero
> terminated, it will mean it reads are most one further byte and on many
> targets strlen is more optimized than strnlen.

I mean hosts.

> 2019-01-04  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR tree-optimization/88693
> 	* tree-ssa-strlen.c (get_min_string_length): Don't set *full_string_p
> 	for STRING_CSTs that don't contain any NUL characters in the first
> 	TREE_STRING_LENGTH bytes.
> 
> 	* gcc.c-torture/execute/pr88693.c: New test.

I'd like to ping this patch.  Thanks.

	Jakub

  parent reply	other threads:[~2019-01-11  9:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-04 22:54 [PATCH] Fix ICU miscompilation due to tree-ssa-strlen.c bug (PR tree-optimization/88693) Jakub Jelinek
2019-01-05  1:10 ` Jeff Law
2019-01-11  9:52 ` Jakub Jelinek [this message]
2019-01-11 18:29 ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190111095227.GH30353@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).