Index: gcc/function.c =================================================================== --- gcc/function.c (revision 107249) +++ gcc/function.c (working copy) @@ -1711,8 +1711,11 @@ aggregate_value_p (tree exp, tree fntype { int i, regno, nregs; rtx reg; + tree type; - tree type = (TYPE_P (exp)) ? exp : TREE_TYPE (exp); + gcc_assert (exp != NULL_TREE); + + type = (TYPE_P (exp)) ? exp : TREE_TYPE (exp); if (fntype) switch (TREE_CODE (fntype)) @@ -3805,6 +3808,7 @@ allocate_struct_function (tree fndecl) cfun->decl = fndecl; result = DECL_RESULT (fndecl); + gcc_assert (result != NULL_TREE); if (aggregate_value_p (result, fndecl)) { #ifdef PCC_STATIC_STRUCT_RETURN