From: Richard Biener <rguenther@suse.de>
To: Jakub Jelinek <jakub@redhat.com>,Ilya Enkovich <enkovich.gnu@gmail.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Fix a -fcheck-pointer-bounds -mmpx ICE (PR target/65523)
Date: Mon, 23 Mar 2015 20:01:00 -0000 [thread overview]
Message-ID: <2ADA2E1B-9037-4444-8D8F-B9BAB3AE63A5@suse.de> (raw)
In-Reply-To: <20150323195454.GA1746@tucnak.redhat.com>
On March 23, 2015 8:54:54 PM GMT+01:00, Jakub Jelinek <jakub@redhat.com> wrote:
>Hi!
>
>On the following testcase we ICE, because we don't verify we have the
>ERF_RETURNS_ARG argument, on non-verified builtins that is possible.
>Other uses of ERF_RETURNS_ARG seem to verify it.
>Also, there was an unneeded extra gimple_call_return_flags call,
>the condition has already checked that ERF_RETURNS_ARG flag is set.
>
>Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
OK.
Thanks,
Richard.
>2015-03-23 Jakub Jelinek <jakub@redhat.com>
>
> PR target/65523
> * tree-chkp.c (chkp_build_returned_bound): Ignore
> ERF_RETURNS_ARG calls if they have fewer than needed arguments.
>
> * gcc.target/i386/pr65523.c: New test.
>
>--- gcc/tree-chkp.c.jj 2015-03-09 08:05:05.000000000 +0100
>+++ gcc/tree-chkp.c 2015-03-23 14:37:52.469289930 +0100
>@@ -2153,6 +2153,7 @@ chkp_build_returned_bound (gcall *call)
> tree bounds;
> gimple stmt;
> tree fndecl = gimple_call_fndecl (call);
>+ unsigned int retflags;
>
> /* To avoid fixing alloca expands in targets we handle
> it separately. */
>@@ -2196,12 +2197,11 @@ chkp_build_returned_bound (gcall *call)
> }
> /* Do not use retbnd when returned bounds are equal to some
> of passed bounds. */
>- else if (gimple_call_return_flags (call) & ERF_RETURNS_ARG)
>+ else if (((retflags = gimple_call_return_flags (call)) &
>ERF_RETURNS_ARG)
>+ && (retflags & ERF_RETURN_ARG_MASK) < gimple_call_num_args (call))
> {
> gimple_stmt_iterator iter = gsi_for_stmt (call);
>- unsigned int retarg = 0, argno;
>- if (gimple_call_return_flags (call) & ERF_RETURNS_ARG)
>- retarg = gimple_call_return_flags (call) & ERF_RETURN_ARG_MASK;
>+ unsigned int retarg = retflags & ERF_RETURN_ARG_MASK, argno;
> if (gimple_call_with_bounds_p (call))
> {
> for (argno = 0; argno < gimple_call_num_args (call); argno++)
>--- gcc/testsuite/gcc.target/i386/pr65523.c.jj 2015-03-23
>14:44:36.977729292 +0100
>+++ gcc/testsuite/gcc.target/i386/pr65523.c 2015-03-23
>14:45:17.518071777 +0100
>@@ -0,0 +1,11 @@
>+/* PR target/65523 */
>+/* { dg-do compile } */
>+/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
>+
>+void *memmove ();
>+
>+void *
>+bar ()
>+{
>+ return memmove ();
>+}
>
> Jakub
next prev parent reply other threads:[~2015-03-23 20:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-23 19:55 Jakub Jelinek
2015-03-23 20:01 ` Richard Biener [this message]
2015-04-23 18:12 ` H.J. Lu
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=2ADA2E1B-9037-4444-8D8F-B9BAB3AE63A5@suse.de \
--to=rguenther@suse.de \
--cc=enkovich.gnu@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@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).