This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[x32] PATCH: Handle NULL TYPE argument in ix86_promote_function_mode
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 7 May 2011 06:47:25 -0700
- Subject: [x32] PATCH: Handle NULL TYPE argument in ix86_promote_function_mode
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
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.
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;