This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/40168] missing unrolling/scalarization/reassoc/free
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 May 2009 10:04:11 -0000
- Subject: [Bug fortran/40168] missing unrolling/scalarization/reassoc/free
- References: <bug-40168-6642@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from rguenth at gcc dot gnu dot org 2009-05-16 10:04 -------
Like so:
Index: trans-expr.c
===================================================================
--- trans-expr.c (revision 147583)
+++ trans-expr.c (working copy)
@@ -4430,7 +4430,8 @@ gfc_trans_zero_assign (gfc_expr * expr)
/* Convert arguments to the correct types. */
if (!POINTER_TYPE_P (TREE_TYPE (dest)))
- dest = gfc_build_addr_expr (pvoid_type_node, dest);
+ return build2 (MODIFY_EXPR, void_type_node,
+ dest, build_constructor (TREE_TYPE (dest), NULL));
else
dest = fold_convert (pvoid_type_node, dest);
len = fold_convert (size_type_node, len);
that leaves FRE to figure that it can CSE a zero from
array1 = {};
in
buffer1 = {};
D.2743_415 = buffer1[54];
and similar cases. buffer2 is later scalarized by SRA.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40168