This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/41758] [Cleanup] Don't resolve expr in gfc_match_allocate
- From: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Oct 2009 22:29:49 -0000
- Subject: [Bug fortran/41758] [Cleanup] Don't resolve expr in gfc_match_allocate
- References: <bug-41758-16146@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from kargl at gcc dot gnu dot org 2009-10-19 22:29 -------
Note, simply commenting out gfc_resolve_expr() leads to regressions
in allocate_alloc_opt_4.f90 and allocate_alloc_opt_6.f90. The reduce
testcase from *_4.f90 is
! { dg-do compile }
program a
implicit none
integer m(3,3)
integer, allocatable :: i(:)
m = 42
allocate(i(4), source=m) ! { dg-error "must be scalar or have the same rank"
}
end program a
which means this chunk of code in gfc_match_allocate isn't triggering.
/* Check C632 and restriction following Note 6.18. */
if (tmp->rank > 0 && conformable_arrays (tmp, head->expr) == FAILURE)
goto cleanup;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41758