This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to fix gcc.dg/pr35899.c failure on IA64 HP-UX
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 31 Jul 2008 12:40:53 -0700 (PDT)
- Subject: Patch to fix gcc.dg/pr35899.c failure on IA64 HP-UX
- Reply-to: sje at cup dot hp dot com
I am getting an segmentation fault when compiling gcc.dg/pr35899.c
on the HP-UX IA64 platform. This test has a call to a function that
is not declared first so the type is unknown. That is causing a null
pointer reference and this patch fixes it. This may be simple enough
to be considered obvious but I thought I would submit it first in case
anyone sees a problem with it.
OK for checkin?
Steve Ellcey
sje@cup.hp.com
2008-07-31 Steve Ellcey <sje@cup.hp.com>
* expr.c (expand_assignment): Check for complete type.
Index: expr.c
===================================================================
--- expr.c (revision 138335)
+++ expr.c (working copy)
@@ -4280,6 +4280,7 @@ expand_assignment (tree to, tree from, b
needs to be done. Handling this in the normal way is safe because no
computation is done before the call. */
if (TREE_CODE (from) == CALL_EXPR && ! aggregate_value_p (from, from)
+ && COMPLETE_TYPE_P (TREE_TYPE (from))
&& TREE_CODE (TYPE_SIZE (TREE_TYPE (from))) == INTEGER_CST
&& ! ((TREE_CODE (to) == VAR_DECL || TREE_CODE (to) == PARM_DECL)
&& REG_P (DECL_RTL (to))))