public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: Jakub Jelinek <jakub@redhat.com>,	Jakub Jelinek <jakub@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Another non-prototype builtin issue (PR middle-end/55890)
Date: Tue, 08 Jan 2013 08:24:00 -0000	[thread overview]
Message-ID: <adb83562-b3aa-45d0-804c-d91ae76ad93d@email.android.com> (raw)
In-Reply-To: <20130107210353.GH7269@tucnak.redhat.com>

Jakub Jelinek <jakub@redhat.com> wrote:

>Hi!
>
>evaluate_stmt can be crashed similarly to what you've fixed today.
>Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

Ok.

Thanks,
Richard.

>2013-01-07  Jakub Jelinek  <jakub@redhat.com>
>
>	PR middle-end/55890
>	* tree-ssa-ccp.c (evaluate_stmt): Use gimple_call_builtin_p.
>
>	* gcc.dg/torture/pr55890-3.c: New test.
>
>--- gcc/tree-ssa-ccp.c.jj	2012-11-19 14:41:17.000000000 +0100
>+++ gcc/tree-ssa-ccp.c	2013-01-07 18:53:39.952854381 +0100
>@@ -1546,7 +1546,6 @@ evaluate_stmt (gimple stmt)
>       && !is_constant)
>     {
>       enum gimple_code code = gimple_code (stmt);
>-      tree fndecl;
>       val.lattice_val = VARYING;
>       val.value = NULL_TREE;
>       val.mask = double_int_minus_one;
>@@ -1593,10 +1592,9 @@ evaluate_stmt (gimple stmt)
> 	      || POINTER_TYPE_P (TREE_TYPE (rhs1)))
> 	    val = bit_value_binop (code, TREE_TYPE (rhs1), rhs1, rhs2);
> 	}
>-      else if (code == GIMPLE_CALL
>-	       && (fndecl = gimple_call_fndecl (stmt))
>-	       && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
>+      else if (gimple_call_builtin_p (stmt, BUILT_IN_NORMAL))
> 	{
>+	  tree fndecl = gimple_call_fndecl (stmt);
> 	  switch (DECL_FUNCTION_CODE (fndecl))
> 	    {
> 	    case BUILT_IN_MALLOC:
>--- gcc/testsuite/gcc.dg/torture/pr55890-3.c.jj	2013-01-07
>18:51:27.415614201 +0100
>+++ gcc/testsuite/gcc.dg/torture/pr55890-3.c	2013-01-07
>18:51:22.864640151 +0100
>@@ -0,0 +1,9 @@
>+/* { dg-do compile } */
>+
>+void *memmove ();
>+
>+void *
>+bar ()
>+{
>+  return memmove ();
>+}
>
>	Jakub


      reply	other threads:[~2013-01-08  8:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-07 21:04 Jakub Jelinek
2013-01-08  8:24 ` Richard Biener [this message]

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=adb83562-b3aa-45d0-804c-d91ae76ad93d@email.android.com \
    --to=rguenther@suse.de \
    --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).