This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fwd: [Patch, Fortran,4.6] Coarray 3/n: Codimension declaration support
- From: Daniel Kraft <d at domob dot eu>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 17 Feb 2010 19:50:41 +0100
- Subject: Re: Fwd: [Patch, Fortran,4.6] Coarray 3/n: Codimension declaration support
- References: <4B751E71.8010403@net-b.de>
Hi Tobias,
Tobias Burnus wrote:
Build and regtested on x86-64-linux.
OK for the 4.6 trunk?
I've given it a look, and below are my comments. In principal the patch
looks good to me, though I'm not yet sure I understand everything that's
going on with co-array declarations.
+coarray:
+ if (gfc_match_char ('[') != MATCH_YES)
+ {
+ goto done;
+ }
I'd prefer to have no {} in this if.
+ if (as->corank)
+ {
+ sym->as->corank = as->corank;
+ for (i = 0; i < as->corank; i++)
+ {
+ sym->as->lower[sym->as->rank + i] = as->lower[i];
+ sym->as->upper[sym->as->rank + i] = as->upper[i];
+ }
+ }
+ else
+ {
+ sym->as->rank = as->rank;
+ sym->as->type = as->type;
+ sym->as->cray_pointee = as->cray_pointee;
+ sym->as->cp_was_assumed = as->cp_was_assumed;
+
+ for (i = 0; i < sym->as->corank; i++)
+ {
+ sym->as->lower[as->rank + i] = sym->as->lower[i];
+ sym->as->upper[as->rank + i] = sym->as->upper[i];
+ }
+ for (i = 0; i < as->rank; i++)
+ {
+ sym->as->lower[i] = as->lower[i];
+ sym->as->upper[i] = as->upper[i];
+ }
+ }
Here I do not really get the logic... If as has a corank, you copy the
co-bounds over in the "if" part; but what's about the ordinary bounds?
Don't they have to be copied?
In the case that as does not have a corank, you do copy both of them.
You probably have a good reason this has to be that way, but I do not
really understand it.
Yours,
Daniel
--
Done: Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Kni-Mon-Pri