This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR56344
- From: Marek Polacek <polacek at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 2 Dec 2013 17:40:33 +0100
- Subject: Re: [PATCH] Fix PR56344
- Authentication-results: sourceware.org; auth=none
- References: <20130226182733 dot GG25197 at redhat dot com> <Pine dot LNX dot 4 dot 64 dot 1302262315110 dot 339 at digraph dot polyomino dot org dot uk> <20130227095625 dot GA15445 at redhat dot com> <CAFiYyc3oPMBH+KYFs=_5xcOX3_DVcZZRE-HaPs3rxu4XEZ4O1Q at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1302271737240 dot 14086 at digraph dot polyomino dot org dot uk> <CAFiYyc3L3b6uk+2Sh4wSg30S-8AdNNFQRPojtfSsF++1L1f3zA at mail dot gmail dot com> <20130305160621 dot GG28076 at redhat dot com> <20130313125702 dot GF18923 at redhat dot com> <CAFiYyc1-Z2GyG53+CDACc4afy7X2bCXzCbKKRhtTLZeFmMxGmQ at mail dot gmail dot com>
On Mon, Dec 02, 2013 at 04:01:05PM +0100, Richard Biener wrote:
> On Wed, Mar 13, 2013 at 1:57 PM, Marek Polacek <polacek@redhat.com> wrote:
> > Ping.
>
> Ok. (yay, oldest patch in my review queue ...)
;) thanks. Just to be sure, did you mean to ok this patch (that is,
the one with HOST_BITS_PER_INT)?
Bootstrap/regtest in progress.
2013-12-02 Marek Polacek <polacek@redhat.com>
PR middle-end/56344
* calls.c (expand_call): Disallow passing huge arguments
by value.
--- gcc/calls.c.mp4 2013-12-02 17:12:18.621057873 +0100
+++ gcc/calls.c 2013-12-02 17:32:35.523684716 +0100
@@ -3047,6 +3047,15 @@ 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 << (HOST_BITS_PER_INT - 1)))
+ {
+ 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)
Marek