summaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-array.c
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-20 20:12:44 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-20 20:12:44 +0000
commit538374c5bb04e6cdda543758bcc1bde25bd4a920 (patch)
tree6d196f924038576c22983777c23d934bf69cf070 /gcc/fortran/trans-array.c
parent5687724f018a4759f01272a4a90cdcb745f59b8a (diff)
downloadgcc-538374c5bb04e6cdda543758bcc1bde25bd4a920.tar.gz
* dependency.c (gfc_full_array_ref_p): Check that ref->next is NULL,
i.e. that the ARRAY_REF doesn't mention components. * trans-array.c (gfc_constant_array_constructor_p): Export external function renamed from constant_array_constructor_p. (gfc_build_constant_array_constructor): Export. (gfc_trans_array_constructor): Update call to the renamed function constant_array_constructor_p. * trans-array.h (gfc_constant_array_constructor_p): Prototype here. (gfc_build_constant_array_constructor): Likewise. * trans-expr.c (gfc_build_memcpy_call): New helper function split out from gfc_trans_array_copy. (gfc_trans_array_copy): Use gfc_build_memcpy_call. (gfc_trans_array_constructor_copy): New function to optimize assigning an entire array from a constant array constructor. (gfc_trans_assignment): Call gfc_trans_array_constructor_copy when appropriate. * gfortran.dg/array_memcpy_3.f90: New test case. * gfortran.dg/vect/vect-5.f90: Update vectorized loop count. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121010 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r--gcc/fortran/trans-array.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 7eb56afa7ea..00a9a1435e4 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -1467,8 +1467,8 @@ get_array_ctor_strlen (gfc_constructor * c, tree * len)
elements, and if so returns the number of those elements, otherwise
return zero. Note, an empty or NULL array constructor returns zero. */
-static unsigned HOST_WIDE_INT
-constant_array_constructor_p (gfc_constructor * c)
+unsigned HOST_WIDE_INT
+gfc_constant_array_constructor_p (gfc_constructor * c)
{
unsigned HOST_WIDE_INT nelem = 0;
@@ -1489,7 +1489,7 @@ constant_array_constructor_p (gfc_constructor * c)
and the tree type of it's elements, TYPE, return a static constant
variable that is compile-time initialized. */
-static tree
+tree
gfc_build_constant_array_constructor (gfc_expr * expr, tree type)
{
tree tmptype, list, init, tmp;
@@ -1633,7 +1633,7 @@ gfc_trans_array_constructor (gfc_loopinfo * loop, gfc_ss * ss)
&& INTEGER_CST_P (loop->from[0])
&& INTEGER_CST_P (loop->to[0]))
{
- unsigned HOST_WIDE_INT nelem = constant_array_constructor_p (c);
+ unsigned HOST_WIDE_INT nelem = gfc_constant_array_constructor_p (c);
if (nelem > 0)
{
tree diff = fold_build2 (MINUS_EXPR, gfc_array_index_type,