trans-expr.c (copyable_array_p): Consider user derived types without allocatable components to be copyable.

* trans-expr.c (copyable_array_p): Consider user derived types without
	allocatable components to be copyable.

	* gfortran.dg/array_memcpy_4.f90: New test case.

From-SVN: r120906
This commit is contained in:
Roger Sayle 2007-01-18 18:19:39 +00:00 committed by Roger Sayle
parent 3bf783b7e2
commit 150524cd45
4 changed files with 28 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2007-01-18 Roger Sayle <roger@eyesopen.com>
* trans-expr.c (copyable_array_p): Consider user derived types without
allocatable components to be copyable.
2007-01-18 Roger Sayle <roger@eyesopen.com>
* trans-stmt.c (compute_overall_iter_number): Enhance to precompute

View File

@ -3815,6 +3815,12 @@ copyable_array_p (gfc_expr * expr)
case BT_LOGICAL:
return true;
case BT_CHARACTER:
return false;
case BT_DERIVED:
return !expr->ts.derived->attr.alloc_comp;
default:
break;
}

View File

@ -1,3 +1,7 @@
2007-01-18 Roger Sayle <roger@eyesopen.com>
* gfortran.dg/array_memcpy_4.f90: New test case.
2007-01-18 Josh Conner <jconner@apple.com>
PR target/30485

View File

@ -0,0 +1,13 @@
! { dg-do compile }
! { dg-options "-O2 -fdump-tree-original" }
type t
logical valid
integer :: x, y
end type
type (t) :: s(5)
type (t) :: d(5)
d = s
end
! { dg-final { scan-tree-dump-times "d = " 1 "original" } }
! { dg-final { cleanup-tree-dump "original" } }