This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch,Fortran] PR 43665 -- add fn-spec annotation based on INTENT settings
- From: Tobias Burnus <burnus at net-b dot de>
- To: gfortran <fortran at gcc dot gnu dot org>, gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 07 Sep 2010 20:58:05 +0200
- Subject: Re: [Patch,Fortran] PR 43665 -- add fn-spec annotation based on INTENT settings
- References: <4C853769.5080406@net-b.de>
Tobias Burnus wrote:
The following patch requires Martin's patch (attached to the PR) or
the option -fno-ipa-cp.as otherwise the argument removal can cause
wrong code.
Martin's patch is now in - and in principle this patch can get in. Thus,
I would like if someone could review this patch. However, ...
I will regtest the patch after Martin's patch is in. Assuming no
failures:
Actually there are failures: gfortran.dg/cray_pointers_2.f90 fails with
-O3 and gfortran.dg/fgetc_2.f90 with -O1. I have only looked at the
latter. It fails because in
st = fgetc(10,s)
if (s(1:1) /= "1") call abort
st = fgetc(10,s)
if (s(1:1) /= "2") call abort
The second "call abort()" is executed unconditionally. That makes sense
if one looks at intrinsics.c:
add_sym_2 ("fputc", ...
where add_sym_2 calls:
add_sym (name, id, cl, actual_ok, type, kind, standard, cf, sf, rf,
a1, type1, kind1, optional1, INTENT_IN,
a2, type2, kind2, optional2, INTENT_IN,
(void *) 0);
Note the INTENT_IN! Thus, optimizing the 's(1:1) /= "2"' check away
makes sense. However, that means that before this patch can get in, one
needs to audit the intrinsics and update the intents.
Therefore: I would be delighted if someone could review the trans-decl.c
part of this patch; however, I plan to send an updated patch with
unchanged/review fixed trans-decl.c and intrinsic.c fixes.
Tobias