This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
How to express the fact that arguments don't escape?
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: Richard Guenther <richard dot guenther at gmail dot com>
- Cc: fortran at gcc dot gnu dot org
- Date: Sat, 15 Aug 2009 01:59:06 +0200
- Subject: How to express the fact that arguments don't escape?
- References: <493FDD92.9030603@net-b.de> <84fc9c000812100724l53799ed4v397d708e8abd2564@mail.gmail.com> <200812101721.39235.franke.daniel@gmail.com> <84fc9c000812100831h379be350ybc9fcfa46f0958b2@mail.gmail.com>
Hi,
I reviewed some old discussions on argument passing, but I found nothing
which addressed a seemingly simple optimization for Fortran: what I
would like to see is a way to tell the compiler that a function argument
(which will be a pointer) will not have escaped after the function has
returned. I.e.
call f(i)
i = 1
call g(j) ! won't know about i
if (i != 1) then
can't happen
end if
Is there a way to do this? Unless I'm mistaken, this assumption holds
for all non-POINTER arguments.
Cheers,
- Tobi