+2011-06-02 Asher Langton <langton2@llnl.gov>
+
+ PR fortran/37039
+ * decl.c (variable_decl): Merge current_as before copying to cp_as.
+
2011-06-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/49265
/* Now we could see the optional array spec. or character length. */
m = gfc_match_array_spec (&as, true, true);
- if (gfc_option.flag_cray_pointer && m == MATCH_YES)
- cp_as = gfc_copy_array_spec (as);
- else if (m == MATCH_ERROR)
+ if (m == MATCH_ERROR)
goto cleanup;
if (m == MATCH_NO)
else if (current_as)
merge_array_spec (current_as, as, true);
+ if (gfc_option.flag_cray_pointer)
+ cp_as = gfc_copy_array_spec (as);
+
/* At this point, we know for sure if the symbol is PARAMETER and can thus
determine (and check) whether it can be implied-shape. If it
was parsed as assumed-size, change it because PARAMETERs can not
--- /dev/null
+! { dg-do compile }
+! { dg-options "-fcray-pointer" }
+!
+! Test for PR37039, from an issue on comp.lang.fortran
+! http://groups.google.com/group/comp.lang.fortran/msg/8cfa06f222721386
+
+ subroutine test(nnode)
+ implicit none
+ integer n,nnode
+ pointer(ip_tab, tab)
+ integer , dimension(1:nnode) :: tab
+ do n=1,nnode
+ tab(n) = 0
+ enddo
+ end subroutine test