This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch to fix gcc.dg/pr35899.c failure on IA64 HP-UX


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))))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]