re PR middle-end/56344 (ICE for program with very large structs returned by value)

PR middle-end/56344
	* calls.c (expand_call): Disallow passing huge arguments
	by value.

From-SVN: r205628
This commit is contained in:
Marek Polacek 2013-12-03 12:11:36 +00:00 committed by Marek Polacek
parent da0fc4547a
commit ddc923b52d
2 changed files with 15 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2013-12-03 Marek Polacek <polacek@redhat.com>
PR middle-end/56344
* calls.c (expand_call): Disallow passing huge arguments
by value.
2013-12-03 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/59362

View File

@ -3045,6 +3045,15 @@ expand_call (tree exp, rtx target, int ignore)
{
rtx before_arg = get_last_insn ();
/* We don't allow passing huge (> 2^30 B) arguments
by value. It would cause an overflow later on. */
if (adjusted_args_size.constant
>= (1 << (HOST_BITS_PER_INT - 2)))
{
sorry ("passing too large argument on stack");
continue;
}
if (store_one_arg (&args[i], argblock, flags,
adjusted_args_size.var != 0,
reg_parm_stack_space)