Message ID | 20130226182733.GG25197@redhat.com |
---|---|
State | New |
Headers | show |
On Tue, 26 Feb 2013, Marek Polacek wrote: > + /* 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 << 30)) > + { > + error ("passing too large argument on stack"); > + continue; This should be sorry () not error (), as a compiler limitation rather than a defect in the user's program. (And is input_location set to something useful here so the diagnostic points to the argument in question rather than e.g. to the end of the function containing the problem call?)
--- gcc/calls.c.mp 2013-02-26 17:04:33.159555349 +0100 +++ gcc/calls.c 2013-02-26 18:50:54.864084545 +0100 @@ -3037,6 +3037,14 @@ expand_call (tree exp, rtx target, int i { 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 << 30)) + { + error ("passing too large argument on stack"); + continue; + } + if (store_one_arg (&args[i], argblock, flags, adjusted_args_size.var != 0, reg_parm_stack_space)