This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Can realloc be marked as a mallloc-like function?
- From: "Janne Blomqvist" <blomqvist dot janne at gmail dot com>
- To: "H.J. Lu" <hjl at lucon dot org>
- Cc: "Tobias Schlüter" <tobias dot schlueter at physik dot uni-muenchen dot de>, gcc at gcc dot gnu dot org, fortran at gcc dot gnu dot org, jb at gcc dot gnu dot org, "GNU C Library" <libc-alpha at sources dot redhat dot com>
- Date: Sun, 15 Jul 2007 10:17:56 +0300
- Subject: Re: Can realloc be marked as a mallloc-like function?
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=XggmEal8MXgcDJCmAw2l/0z4YVLKSF5h57Yw4zIfglwV5xdc6felm3c0EAs/GvfPTlmDVCSuPq8QQUYv/Xnza4SE2gSYA/k/GXd8NRuuKpNrwzpjICIRlROJR3DIoej7kT9mmPwLjseK7zcfT9AFZ356UoN/QdzLu6bGboWD6UU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=d4u733/6EqyupTqvynIAfakFsZV0/4MfR/m01JnnKZ+tbgZtM9W28JUzwSHJT1psdnHzQ8eVpwR2c16/1eGqrzP6D5oScF3+whYaMyNM0IlRfiO/290dGIXQuCnfWgi1tpdY2NjOgY0pzXaZf5/bTErtOV3gVpQyTSG521+4xHo=
- References: <20070714160016.GA7949@lucon.org> <4698F3D5.8090700@physik.uni-muenchen.de> <20070714162019.GA8046@lucon.org>
On 7/14/07, H.J. Lu <hjl@lucon.org> wrote:
On Sat, Jul 14, 2007 at 06:03:33PM +0200, Tobias Schlüter wrote:
> H.J. Lu wrote:
> >It looks like gcc assumes a functon marked with DECL_IS_MALLOC won't
> >return an address which can alias something else. But it isn't true
> >for realloc. Now, the qestions are
> >
> >1. Can gcc make such an assumption?
> >2. Can realloc be marked as DECL_IS_MALLOC.
> >
> >BTW, glibc also marks realloc with __attribute_malloc__.
>
> There was an absurdely long thread on this topic starting at
> <http://gcc.gnu.org/ml/gcc/2004-01/msg00005.html>. I didn't dig through
> it to find the answer.
Now, we have a real testcase to show the problem. How do we solve
it?
I assigned the bug to myself, since I caused it. However, as the
regression is not seen on x86, I suppose there is only so much I can
do. HJL, can you confirm that indeed removing only the DECL_IS_MALLOC
of internal_realloc fixes the issue on IA-64?
When I get back home tonight I'll take a look at the trees created by
array_constructor_6 and see if we do something obviously stupid, i.e.
can the frontend be fixed in some other way so that we can still keep
internal_realloc marked with DECL_IS_MALLOC.
--
Janne Blomqvist