This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, fortran] [13/14] Support coarray subreferences: don't force coarray lower bound to 1.


gfc_build_array_type was forcing the lower bound to zero in cases where it was
unspecified (NULL). This is wrong for deferred (allocatable) coarrays at least,
as their cobound is specified at allocation time.
This patch fixes that. 
I don't think other cases beyond AS_DEFERRED need fixing, but I wouldn't mind
a confirmation. ;-)

OK?
 

Attachment: pr50420-13.CL
Description: Text document

diff --git a/trans-types.c b/trans-types.c
index 43f1a19..652c009 100644
--- a/trans-types.c
+++ b/trans-types.c
@@ -1256,7 +1256,7 @@ gfc_build_array_type (tree type, gfc_array_spec * as,
 
   for (n = as->rank; n < as->rank + as->corank; n++)
     {
-      if (as->lower[n] == NULL)
+      if (as->type != AS_DEFERRED && as->lower[n] == NULL)
         lbound[n] = gfc_index_one_node;
       else
         lbound[n] = gfc_conv_array_bound (as->lower[n]);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]