From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68545 invoked by alias); 1 Jun 2015 21:09:12 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 68533 invoked by uid 89); 1 Jun 2015 21:09:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 01 Jun 2015 21:09:10 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id D2B352852CE4; Mon, 1 Jun 2015 23:09:06 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id URNB8xWFessi; Mon, 1 Jun 2015 23:09:06 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id AE4B42852206; Mon, 1 Jun 2015 23:09:06 +0200 (CEST) From: Eric Botcazou To: Richard Biener 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 Message-ID: <8241816.OIB72BoWyX@polaris> User-Agent: KMail/4.7.2 (Linux/3.1.10-1.29-desktop; KDE/4.7.2; x86_64; ; ) In-Reply-To: References: <2953955.A7ElB1Yu05@polaris> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-SW-Source: 2015-06/txt/msg00127.txt.bz2 > 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