Commit ba9a8625 by Eric Botcazou Committed by Eric Botcazou

cfgexpand.c (expand_one_var): Use specific wording in error message for non-local frame variables.

	* 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.

From-SVN: r265305
parent 079c81d0
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.
......@@ -1674,7 +1674,12 @@ expand_one_var (tree var, bool toplevel, bool really_expand)
/* 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 known_align)
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
......
-- { 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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment