+2018-10-19 Eric Botcazou <ebotcazou@adacore.com>
+
+ * cfgexpand.c (expand_one_var): Use specific wording in error message
+ for non-local frame variables.
+ * stor-layout.c (layout_decl): Do not issue a warning for them.
+
2018-10-19 Robin Dapp <rdapp@linux.ibm.com>
* haifa-sched.c (priority): Add force_recompute parameter.
/* 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);
}
}
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);
+2018-10-19 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/frame_overflow2.adb: New test.
+
2018-10-18 H.J. Lu <hongjiu.lu@intel.com>
PR target/72782
--- /dev/null
+-- { dg-do compile }
+
+with System;
+
+procedure Frame_Overflow2 is -- { dg-error "too large" }
+
+ type Index_T is range 1 .. 2**(System.Word_Size - 1) - 1;
+
+ type SetArray is array (Index_T) of Boolean;
+
+ type Set is record
+ Store: SetArray := (Others => False);
+ end record;
+
+ Phi: constant Set := (Store => (Others => False));
+
+ function F return Set is
+ begin
+ return Phi;
+ end;
+
+begin
+ null;
+end;