Patchwork [x32] PATCH: Handle NULL TYPE argument in ix86_promote_function_mode

login
register
mail settings
Submitter H.J. Lu
Date May 7, 2011, 1:47 p.m.
Message ID <20110507134725.GA18470@lucon.org>
Download mbox | patch
Permalink /patch/94490/
State New
Headers show

Comments

H.J. Lu - May 7, 2011, 1:47 p.m.
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 <hjl.tools@gmail.com>
Date:   Fri May 6 10:02:18 2011 -0700

    Handle NULL TYPE argument.

Patch

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  <hongjiu.lu@intel.com>
+
+	* config/i386/i386.c (ix86_promote_function_mode): Handle NULL
+	TYPE argument.
+
 2011-04-14  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* 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;