This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/40168] missing unrolling/scalarization/reassoc/free



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]