aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-array.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-11-20 22:35:03 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2008-11-20 22:35:03 +0100
commit81f5094da422fbdf4f76e80f6dbc52df91582a46 (patch)
tree0cc48991865f78326414c0d9ce7c0db3f4e962e0 /gcc/fortran/trans-array.c
parent1fd8faf0599d4054a7a6118c35fc0ef6c2db5e4a (diff)
downloadgcc-81f5094da422fbdf4f76e80f6dbc52df91582a46.zip
gcc-81f5094da422fbdf4f76e80f6dbc52df91582a46.tar.gz
gcc-81f5094da422fbdf4f76e80f6dbc52df91582a46.tar.bz2
re PR middle-end/29215 (extra store for memcpy)
PR middle-end/29215 * builtins.c (SLOW_UNALIGNED_ACCESS): Define if not defined. (fold_builtin_memory_op): Handle even the case where just one of src and dest is an address of a var decl component, using TYPE_REF_CAN_ALIAS_ALL pointers. Remove is_gimple_min_invariant and readonly_data_expr src check. * tree-ssa-sccvn.c (DFS): Use clear_and_done_ssa_iter to shut up warnings. * trans-array.c (trans_array_constructor_value, gfc_build_constant_array_constructor): Fill in TREE_PURPOSE. * gfortran.dg/array_memcpy_3.f90: Adjust pattern to match even memcpy optimized into ref-all store. * gcc.dg/pr29215.c: New test. From-SVN: r142061
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r--gcc/fortran/trans-array.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 9c48c42..1385409 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -1235,6 +1235,7 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type,
tree init;
tree bound;
tree tmptype;
+ HOST_WIDE_INT idx = 0;
p = c;
list = NULL_TREE;
@@ -1253,7 +1254,8 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type,
(gfc_get_pchar_type (p->expr->ts.kind),
se.expr);
- list = tree_cons (NULL_TREE, se.expr, list);
+ list = tree_cons (build_int_cst (gfc_array_index_type,
+ idx++), se.expr, list);
c = p;
p = p->next;
}
@@ -1619,7 +1621,8 @@ gfc_build_constant_array_constructor (gfc_expr * expr, tree type)
if (c->expr->ts.type == BT_CHARACTER && POINTER_TYPE_P (type))
se.expr = gfc_build_addr_expr (gfc_get_pchar_type (c->expr->ts.kind),
se.expr);
- list = tree_cons (NULL_TREE, se.expr, list);
+ list = tree_cons (build_int_cst (gfc_array_index_type, nelem),
+ se.expr, list);
c = c->next;
nelem++;
}