From patchwork Sat May 7 13:47:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 94490 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 0308AB703E for ; Sat, 7 May 2011 23:47:49 +1000 (EST) Received: (qmail 32105 invoked by alias); 7 May 2011 13:47:41 -0000 Received: (qmail 32096 invoked by uid 22791); 7 May 2011 13:47:41 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL, BAYES_00, NO_DNS_FOR_FROM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 07 May 2011 13:47:27 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 07 May 2011 06:47:26 -0700 X-ExtLoop1: 1 Received: from gnu-4.sc.intel.com ([10.3.194.56]) by orsmga002.jf.intel.com with ESMTP; 07 May 2011 06:47:26 -0700 Received: by gnu-4.sc.intel.com (Postfix, from userid 500) id 0E35520245; Sat, 7 May 2011 06:47:25 -0700 (PDT) Date: Sat, 7 May 2011 06:47:25 -0700 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Subject: [x32] PATCH: Handle NULL TYPE argument in ix86_promote_function_mode Message-ID: <20110507134725.GA18470@lucon.org> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, TYPE may be NULL in ix86_promote_function_mode. I checked in this patch to handle it. H.J. --- commit 31770e61e70228463b70361c46ff6fa81eb856f8 Author: H.J. Lu Date: Fri May 6 10:02:18 2011 -0700 Handle NULL TYPE argument. diff --git a/gcc/ChangeLog.x32 b/gcc/ChangeLog.x32 index 57b2786..9426489 100644 --- a/gcc/ChangeLog.x32 +++ b/gcc/ChangeLog.x32 @@ -1,3 +1,8 @@ +2011-05-06 H.J. Lu + + * config/i386/i386.c (ix86_promote_function_mode): Handle NULL + TYPE argument. + 2011-04-14 H.J. Lu * config/i386/gnu-user64.h (ASM_SPEC): Support x32. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 3e5169e..1a567f1 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -7673,7 +7673,7 @@ ix86_promote_function_mode (const_tree type, enum machine_mode mode, int *punsignedp, const_tree fntype, int for_return) { - if (for_return != 1 && POINTER_TYPE_P (type)) + if (for_return != 1 && type != NULL_TREE && POINTER_TYPE_P (type)) { *punsignedp = POINTERS_EXTEND_UNSIGNED; return Pmode;