public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Eric Botcazou <ebotcazou@adacore.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [patch] Fix ICE on function [not] returning variable size
Date: Mon, 01 Jun 2015 21:10:00 -0000	[thread overview]
Message-ID: <8241816.OIB72BoWyX@polaris> (raw)
In-Reply-To: <CAFiYyc0d7qt3N1P5-wF-sT804twNd2KJfDXC3pGbYGDcMniPoA@mail.gmail.com>

> Ok.  (I wonder if there are any cases where the return value is allocated by
> the callee?)

Thanks.

Do you mean in GCC or in programming languages in general or...?  In GNAT, we 
have something like that: when a function returns an unconstrained type whose 
size depends on some discriminants of the type, the caller doesn't know the 
size of the return value in advance, so the callee allocates the return value 
on the "secondary stack" and effectively returns a pointer to it.  Of course 
you need a specific machinery to manage this secondary stack.  And, needless 
to say, this is quite inefficient, so we attempt to reduce its usage:
  https://gcc.gnu.org/ml/gcc-patches/2015-05/msg02632.html

-- 
Eric Botcazou

  reply	other threads:[~2015-06-01 21:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 10:45 Eric Botcazou
2015-06-01 11:19 ` Richard Biener
2015-06-01 21:10   ` Eric Botcazou [this message]
2015-06-02  8:30     ` Richard Biener
2015-06-02  9:30       ` Eric Botcazou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8241816.OIB72BoWyX@polaris \
    --to=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).