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 tree-optimization/69541] New: check ssa more often in parloops


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69541

            Bug ID: 69541
           Summary: check ssa more often in parloops
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: trivial
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

It happens that we run into a parloops ssa update failure while processing loop
y, but the faulty ssa was introduced while processing loop x. This is somewhat
confusing, and it probably makes sense to verify ssa after processing each
loop:
 ...
@@ -2413,11 +2416,18 @@ gen_parallel_loop (struct loop *loop,
   if (reduction_list->elements () > 0)
     create_call_for_reduction (loop, reduction_list, &clsn_data);

+  update_ssa (TODO_update_ssa);
+  verify_ssa (true, true);
+
   scev_reset ();

   /* Free loop bound estimations that could contain references to
...
Perhaps only if flag_checking.

Furthermore, to pinpoint where the error is introduced, I tend to move the
update_ssa/verify_ssa calls backwards in gen_parallel_loop. But that doesn't
work at points were we always have invalid ssa, which is the case before
gen_parallel loop.  This patch fixes that:
...
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index 139e38c..2086a21 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -1411,6 +1411,8 @@ separate_decls_in_region (edge entry, edge exit,
       nvar = create_tmp_var (build_pointer_type (type), ".paral_data_load");
       *new_arg_struct = make_ssa_name (nvar);

+      SSA_NAME_IS_DEFAULT_DEF (*new_arg_struct) = 1;
+      SSA_NAME_DEF_STMT (*new_arg_struct) = gimple_build_nop ();
       ld_st_data->store = *arg_struct;
       ld_st_data->load = *new_arg_struct;
       ld_st_data->store_bb = bb0;
@@ -2070,6 +2072,7 @@ create_parallel_loop (struct loop *loop, tree loop_fn,
tree data,

          assign_stmt = gimple_build_assign (new_data,
                                             fold_convert (TREE_TYPE
(new_data), param));
+         SSA_NAME_IS_DEFAULT_DEF (new_data) = 0;
          gsi_insert_before (&gsi, assign_stmt, GSI_SAME_STMT);
        }
...

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