From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28403 invoked by alias); 7 Aug 2007 19:29:09 -0000 Received: (qmail 28250 invoked by uid 22791); 7 Aug 2007 19:29:07 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 07 Aug 2007 19:29:03 +0000 Received: from zps35.corp.google.com (zps35.corp.google.com [172.25.146.35]) by smtp-out.google.com with ESMTP id l77JSrno020868 for ; Tue, 7 Aug 2007 12:28:54 -0700 Received: from frodo.local ([172.29.122.236]) by zps35.corp.google.com with ESMTP id l77JSSqV000471 for ; Tue, 7 Aug 2007 12:28:29 -0700 Message-ID: <46B8C7E5.4070805@google.com> Date: Tue, 07 Aug 2007 19:29:00 -0000 From: Diego Novillo User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org Subject: [tuples] Fix remaining gimplifier ICEs in check-gcc Content-Type: multipart/mixed; boundary="------------020408050507030006010004" X-IsSubscribed: yes 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: 2007-08/txt/msg00453.txt.bz2 This is a multi-part message in MIME format. --------------020408050507030006010004 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 202 This patch adds a new function to determine the type returned by a GIMPLE_CALL. This was causing the only check-gcc failure in the gimplifier. Now on to the gimplifier ICEs in the other front ends. --------------020408050507030006010004 Content-Type: text/x-patch; name="20070807-add-gimple_call_return_type.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="20070807-add-gimple_call_return_type.diff" Content-length: 1511 2007-08-07 Diego Novillo * gimple.h (gimple_call_return): New. * gimplify.c (get_tmp_var_for): Call it. Index: gimplify.c =================================================================== --- gimplify.c (revision 127275) +++ gimplify.c (working copy) @@ -634,9 +634,9 @@ get_tmp_var_for (gimple stmt) /* FIXME tuples, add support for formal temporaries (worth it?) */ if (code == GIMPLE_ASSIGN) - return create_tmp_from_val (gimple_assign_operand (stmt, 1)); + lhs = create_tmp_from_val (gimple_assign_operand (stmt, 1)); else if (code == GIMPLE_CALL) - return create_tmp_var (TREE_TYPE (TREE_TYPE (gimple_call_fn (stmt))), + lhs = create_tmp_var (gimple_call_return_type (stmt), get_name (gimple_call_fn (stmt))); else gcc_unreachable (); Index: gimple.h =================================================================== --- gimple.h (revision 127275) +++ gimple.h (working copy) @@ -574,6 +574,23 @@ gimple_call_fn (gimple gs) } static inline tree +gimple_call_return_type (gimple gs) +{ + tree fn = gimple_call_fn (gs); + tree type = TREE_TYPE (fn); + + /* See through pointer to functions. */ + if (TREE_CODE (type) == POINTER_TYPE) + type = TREE_TYPE (type); + + gcc_assert (TREE_CODE (type) == FUNCTION_TYPE); + + /* The type returned by a FUNCTION_DECL is the type of its + function type. */ + return TREE_TYPE (type); +} + +static inline tree gimple_call_chain (gimple gs) { GIMPLE_CHECK (gs, GIMPLE_CALL); --------------020408050507030006010004--