From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1975 invoked by alias); 8 Jan 2013 08:24:51 -0000 Received: (qmail 1953 invoked by uid 22791); 8 Jan 2013 08:24:47 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,TW_FN,TW_TM X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 08 Jan 2013 08:24:41 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 2D528A341E; Tue, 8 Jan 2013 09:24:40 +0100 (CET) User-Agent: K-9 Mail for Android In-Reply-To: <20130107210353.GH7269@tucnak.redhat.com> References: <20130107210353.GH7269@tucnak.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [PATCH] Another non-prototype builtin issue (PR middle-end/55890) From: Richard Biener Date: Tue, 08 Jan 2013 08:24:00 -0000 To: Jakub Jelinek , Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Message-ID: Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg00390.txt.bz2 Jakub Jelinek 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 > > 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