===================================================================
@@ -1674,7 +1674,12 @@ expand_one_var (tree var, bool toplevel,
/* Reject variables which cover more than half of the address-space. */
if (really_expand)
{
- error ("size of variable %q+D is too large", var);
+ if (DECL_NONLOCAL_FRAME (var))
+ error_at (DECL_SOURCE_LOCATION (current_function_decl),
+ "total size of local objects is too large");
+ else
+ error_at (DECL_SOURCE_LOCATION (var),
+ "size of variable %q+D is too large", var);
expand_one_error_var (var);
}
}
===================================================================
@@ -755,8 +755,8 @@ layout_decl (tree decl, unsigned int kno
DECL_SIZE_UNIT (decl) = variable_size (DECL_SIZE_UNIT (decl));
/* If requested, warn about definitions of large data objects. */
- if ((code == VAR_DECL || code == PARM_DECL)
- && ! DECL_EXTERNAL (decl))
+ if ((code == PARM_DECL || (code == VAR_DECL && !DECL_NONLOCAL_FRAME (decl)))
+ && !DECL_EXTERNAL (decl))
{
tree size = DECL_SIZE_UNIT (decl);