This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/42958] Weird temporary array allocation
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Mar 2010 14:45:39 -0000
- Subject: [Bug fortran/42958] Weird temporary array allocation
- References: <bug-42958-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #16 from rguenther at suse dot de 2010-03-28 14:45 -------
Subject: Re: Weird temporary array allocation
On Sun, 28 Mar 2010, burnus at gcc dot gnu dot org wrote:
> ------- Comment #15 from burnus at gcc dot gnu dot org 2010-03-28 14:10 -------
> Actually, I am wondering whether one needs to do
> D.1620_135 = __builtin_malloc (1);
> for temporary arrays. For user-accessible ALLOCATABLE arrays one does - because
> ALLOCATED(array) needs also to be .TRUE. for zero-sized arrays, but for
> temporary arrays one does not. For those one could just do
> D.1620_135 = 0B
> Will the middle-end optimize __builtin_free(NULL) away?
Not yet, but that's easy to implement. Note that I will be looking
in detail into malloc/free optimizations, including moving allocation
out of loops. So there's no need to rush anything and it can wait
for 4.6.
Richard.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42958