This is the mail archive of the gcc-patches@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]

Re: [1/6] Fold prev/next into gimple, prepare bulk


On Wed, May 2, 2012 at 3:02 AM, Michael Matz <matz@suse.de> wrote:
> Hi,
>
> so this patch will basically ensure that statements are in one sequence
> max at any time, by reordering some code that e.g. inserts the statement
> already in seq2 (while it still is in seq1) and only afterwards
> gsi_removes it from seq1.
>
> It will also do one trivial, but very bulky change: Later on (patch 6) the
> iterator will contain a pointer to a sequence, and writing to an iterator
> can change the pointed to sequence. ?Basically everything that modifies
> sequences could also modify the head, which later will be a simple gimple
> statement, not some member in a gimple_seq structure. ?Hence we can't pass
> around gimple_seq by value when there's the possibility of it becoming
> changed.
>
> So, we have to pass around pointers to sequences in some more interfaces.
> Luckily not many: walk_gimple_seq, lower_omp, lower_sequence, walk_body
> and lower_eh_constructs_1. ?Of course all callers have to be adjusted, and
> that's the bulk of the changes (omp-low.c, gimple-low.c, tree-nested.c,
> gimple.c and tree-eh.c).
>
> To get to pointers to sequences, I've added several accessors in gimple.h
> ala gimple_bind_body_ptr returning the address of the respective
> gimple_seq member of the statement (and adjusted the existing ones like
> gimple_bind_body to use them). ?That's the gimple.h changes.
>
> I've also abstracted away the *gsi_stmt_ptr() = new_stmt idiom into a
> gsi_set_stmt function (which needs to be adjusted later), made uses of
> gsi_start_phis, adjusted the interface to gsi_split_seq_before and made
> some other cleanups.
>
> All in all this patch should be a functional no-op to the compiler.
>
> As said in the [0/6] mail, regstrapped together with the other five
> patches. ?Okay for trunk?

Ok.

Thanks,
Richard.

>
> Ciao,
> Michael.
> ---------------------
> ? ? ? ?* gimple.h (gimple_bind_body_ptr): New function.
> ? ? ? ?(gimple_bind_body): Use it.
> ? ? ? ?(gimple_catch_handler): Use gimple_catch_handler_ptr.
> ? ? ? ?(gimple_eh_filter_failure_ptr): New function.
> ? ? ? ?(gimple_eh_filter_failure): Use it.
> ? ? ? ?(gimple_eh_else_n_body_ptr): New function.
> ? ? ? ?(gimple_eh_else_n_body): Use it.
> ? ? ? ?(gimple_eh_else_e_body_ptr): New function.
> ? ? ? ?(gimple_eh_else_e_body): Use it.
> ? ? ? ?(gimple_try_eval_ptr): New function.
> ? ? ? ?(gimple_try_eval): Use it.
> ? ? ? ?(gimple_try_cleanup_ptr): New function.
> ? ? ? ?(gimple_try_cleanup): Use it.
> ? ? ? ?(gimple_wce_cleanup_ptr): New function.
> ? ? ? ?(gimple_wce_cleanup): Use it.
> ? ? ? ?(gimple_omp_body_ptr): New function.
> ? ? ? ?(gimple_omp_body): Use it.
> ? ? ? ?(gimple_omp_for_pre_body_ptr): New function.
> ? ? ? ?(gimple_omp_for_pre_body): Use it.
> ? ? ? ?(gimple_transaction_body_ptr): New function.
> ? ? ? ?(gimple_transaction_body): Use it.
> ? ? ? ?(gsi_split_seq_before): Adjust to return nothing and take pointer
> ? ? ? ?to sequence.
> ? ? ? ?(gsi_set_stmt): Declare.
> ? ? ? ?(gsi_replace_with_seq): Declare.
> ? ? ? ?(walk_gimple_seq_mod): Declare.
> ? ? ? ?* function.h (struct function <gimple_body>): Use typedef gimple_seq.
>
> ? ? ? ?* gimple-iterator.c (gsi_set_stmt): New function.
> ? ? ? ?(gsi_split_seq_before): Return new sequence via pointer argument.
> ? ? ? ?(gsi_replace): Use gsi_set_stmt.
>
> ? ? ? ?* tree-ssa-loop-im.c (move_computations_stmt): First remove
> ? ? ? ?then insert stmt.
> ? ? ? ?* tree-complex.c (update_complex_components_on_edge): Don't
> ? ? ? ?copy gsi.
> ? ? ? ?* tree-phinodes.c (resize_phi_node): Don't resize stmt in-place,
> ? ? ? ?return new stmt.
> ? ? ? ?(reserve_phi_args_for_new_edge): Change call to above,
> ? ? ? ?use gsi_set_stmt.
>
> ? ? ? ?* omp-low.c (lower_omp): Change prototype to take pointer to
> ? ? ? ?sequence.
> ? ? ? ?(lower_rec_input_clauses): Use gimple_seq_add_seq instead of
> ? ? ? ?iterators. ?Adjust call to lower_omp.
> ? ? ? ?(lower_lastprivate_clauses): Adjust call to lower_omp.
> ? ? ? ?(lower_reduction_clauses): Ditto.
> ? ? ? ?(expand_omp_taskreg): Nullify non-cfg body of child_fn.
> ? ? ? ?(lower_omp_sections): Don't explicitely count sequence length,
> ? ? ? ?nullify lowered bodies earlier, ensure stmts are part of only
> ? ? ? ?one sequence, adjust call to lower_omp.
> ? ? ? ?(lower_omp_single): Ensure stmts are part of only one sequence,
> ? ? ? ?adjust call to lower_omp.
> ? ? ? ?(lower_omp_master): Ditto.
> ? ? ? ?(lower_omp_ordered): Ditto.
> ? ? ? ?(lower_omp_critical): Ditto.
> ? ? ? ?(lower_omp_for): Ditto.
> ? ? ? ?(lower_omp_taskreg): Ditto, tidy.
> ? ? ? ?(lower_omp_1): Adjust calls to lower_omp.
> ? ? ? ?(execute_lower_omp): Ditto.
> ? ? ? ?(lower_omp): Adjust to take pointer to sequence.
> ? ? ? ?(diagnose_sb_2): Use walk_gimple_seq_mod.
> ? ? ? ?(diagnose_omp_structured_block_errors): Ditto and set possibly
> ? ? ? ?changed function body.
> ? ? ? ?* gimple-low.c (lower_function_body): Set function body after
> ? ? ? ?it stabilizes.
> ? ? ? ?(lower_sequence): Adjust to take pointer to sequence.
> ? ? ? ?(lower_omp_directive): Ensure stmt isn't put twice into the
> ? ? ? ?sequence, adjust call to lower_sequence.
> ? ? ? ?(lower_stmt): Adjust calls to lower_sequence.
> ? ? ? ?(lower_gimple_bind): Ditto.
> ? ? ? ?(gimple_try_catch_may_fallthru): Call gsi_start with lvalue.
> ? ? ? ?* tree-nested.c (walk_body): Take pointer to sequence, use
> ? ? ? ?walk_gimple_seq_mod.
> ? ? ? ?(walk_function): Adjust call to walk_body, set possibly changed
> ? ? ? ?body.
> ? ? ? ?(walk_gimple_omp_for): Adjust calls to walk_body.
> ? ? ? ?(convert_nonlocal_omp_clauses): Ditto.
> ? ? ? ?(convert_nonlocal_reference_stmt): Ditto.
> ? ? ? ?(convert_local_omp_clauses): Ditto.
> ? ? ? ?(convert_local_reference_stmt): Ditto.
> ? ? ? ?(convert_tramp_reference_stmt): Ditto.
> ? ? ? ?(convert_gimple_call): Ditto.
> ? ? ? ?(convert_nl_goto_reference): Use local iterator copy.
> ? ? ? ?* gimple.c (walk_gimple_seq_mod): Renamed from walk_gimple_seq,
> ? ? ? ?but taking pointer to sequence, ensure gsi_start is called with
> ? ? ? ?callers lvalue.
> ? ? ? ?(walk_gimple_seq): New wrapper around walk_gimple_seq_mod,
> ? ? ? ?asserting that the sequence head didn't change.
> ? ? ? ?(walk_gimple_stmt): Replace all calls to walk_gimple_seq with
> ? ? ? ?walk_gimple_seq_mod.
> ? ? ? ?* trans-mem.c (lower_transaction): Use walk_gimple_seq_mod.
> ? ? ? ?(execute_lower_tm): Ditto, and set possibly changed body.
> ? ? ? ?* tree-eh.c (lower_eh_constructs_1): Take pointer to sequence,
> ? ? ? ?call gsi_start with that lvalue.
> ? ? ? ?(replace_goto_queue_stmt_list): Ditto.
> ? ? ? ?(replace_goto_queue_1): Adjust calls to replace_goto_queue_stmt_list.
> ? ? ? ?(replace_goto_queue): Ditto.
> ? ? ? ?(lower_try_finally_nofallthru): Adjust calls to lower_eh_constructs_1.
> ? ? ? ?(lower_try_finally_onedest): Ditto.
> ? ? ? ?(lower_try_finally_copy): Ditto.
> ? ? ? ?(lower_try_finally_switch): Ditto.
> ? ? ? ?(lower_try_finally): Ditto.
> ? ? ? ?(lower_eh_filter): Ditto.
> ? ? ? ?(lower_eh_must_not_throw): Ditto.
> ? ? ? ?(lower_cleanup): Ditto.
> ? ? ? ?(lower_eh_constructs_2): Ditto.
> ? ? ? ?(lower_catch): Ditto, and ensure gsi_start is called with lvalue.
> ? ? ? ?(lower_eh_constructs): Adjust calls to lower_eh_constructs_1, and
> ? ? ? ?set possibly changed body.
> ? ? ? ?(optimize_double_finally): Call gsi_start with lvalue.
>
> ? ? ? ?* tree-cfg.c (make_blocks): Adjust call to gsi_split_seq_before.
> ? ? ? ?(gimple_split_block): Ditto.
> ? ? ? ?(gimple_merge_blocks): Use gsi_start_phis.
> ? ? ? ?(move_stmt_r): Use walk_gimple_seq_mod.
> ? ? ? ?* tree-ssa-dse.c (dse_enter_block): Use gsi_last_bb.
> ? ? ? ?* cgraphbuild.c (build_cgraph_edges): Use gsi_start_phis.
> ? ? ? ?(rebuild_cgraph_edges): Ditto.
> ? ? ? ?(cgraph_rebuild_references): Ditto.
> ? ? ? ?* ipa-prop.c (ipa_analyze_params_uses): Ditto.
> ? ? ? ?* tree-inline.c (copy_phis_for_bb): Ditto.
> ? ? ? ?* tree-ssa-dce.c: Ditto.
>
> ? ? ? ?* cgraphunit.c (cgraph_analyze_function): Use gimple_has_body_p.
>
> Index: tree-ssa-loop-im.c
> ===================================================================
> *** tree-ssa-loop-im.c.orig ? ? 2012-05-01 22:43:31.000000000 +0200
> --- tree-ssa-loop-im.c ?2012-05-01 22:43:34.000000000 +0200
> *************** move_computations_stmt (struct dom_walk_
> *** 1328,1335 ****
> ? ? ? ?}
>
> ? ? ? ?mark_virtual_ops_for_renaming (stmt);
> - ? ? ? gsi_insert_on_edge (loop_preheader_edge (level), stmt);
> ? ? ? ?gsi_remove (&bsi, false);
> ? ? ?}
> ?}
>
> --- 1328,1335 ----
> ? ? ? ?}
>
> ? ? ? ?mark_virtual_ops_for_renaming (stmt);
> ? ? ? ?gsi_remove (&bsi, false);
> + ? ? ? gsi_insert_on_edge (loop_preheader_edge (level), stmt);
> ? ? ?}
> ?}
>
> Index: tree-complex.c
> ===================================================================
> *** tree-complex.c.orig 2012-05-01 22:43:31.000000000 +0200
> --- tree-complex.c ? ? ?2012-05-01 22:43:34.000000000 +0200
> *************** update_complex_components_on_edge (edge
> *** 661,677 ****
> ?static void
> ?update_complex_assignment (gimple_stmt_iterator *gsi, tree r, tree i)
> ?{
> - ? gimple_stmt_iterator orig_si = *gsi;
> ? ?gimple stmt;
>
> ! ? if (gimple_in_ssa_p (cfun))
> ! ? ? update_complex_components (gsi, gsi_stmt (*gsi), r, i);
> !
> ! ? gimple_assign_set_rhs_with_ops (&orig_si, COMPLEX_EXPR, r, i);
> ! ? stmt = gsi_stmt (orig_si);
> ? ?update_stmt (stmt);
> ? ?if (maybe_clean_eh_stmt (stmt))
> ? ? ?gimple_purge_dead_eh_edges (gimple_bb (stmt));
> ?}
>
>
> --- 661,676 ----
> ?static void
> ?update_complex_assignment (gimple_stmt_iterator *gsi, tree r, tree i)
> ?{
> ? ?gimple stmt;
>
> ! ? gimple_assign_set_rhs_with_ops (gsi, COMPLEX_EXPR, r, i);
> ! ? stmt = gsi_stmt (*gsi);
> ? ?update_stmt (stmt);
> ? ?if (maybe_clean_eh_stmt (stmt))
> ? ? ?gimple_purge_dead_eh_edges (gimple_bb (stmt));
> +
> + ? if (gimple_in_ssa_p (cfun))
> + ? ? update_complex_components (gsi, gsi_stmt (*gsi), r, i);
> ?}
>
>
> Index: tree-phinodes.c
> ===================================================================
> *** tree-phinodes.c.orig ? ? ? ?2012-05-01 22:43:31.000000000 +0200
> --- tree-phinodes.c ? ? 2012-05-02 01:53:33.000000000 +0200
> *************** release_phi_node (gimple phi)
> *** 269,297 ****
> ?/* Resize an existing PHI node. ?The only way is up. ?Return the
> ? ? possibly relocated phi. ?*/
>
> ! static void
> ! resize_phi_node (gimple *phi, size_t len)
> ?{
> ? ?size_t old_size, i;
> ? ?gimple new_phi;
>
> ! ? gcc_assert (len > gimple_phi_capacity (*phi));
>
> ? ?/* The garbage collector will not look at the PHI node beyond the
> ? ? ? first PHI_NUM_ARGS elements. ?Therefore, all we have to copy is a
> ? ? ? portion of the PHI node currently in use. ?*/
> ? ?old_size = sizeof (struct gimple_statement_phi)
> ! ? ? ? ? ? ?+ (gimple_phi_num_args (*phi) - 1) * sizeof (struct phi_arg_d);
>
> ? ?new_phi = allocate_phi_node (len);
>
> ! ? memcpy (new_phi, *phi, old_size);
>
> ? ?for (i = 0; i < gimple_phi_num_args (new_phi); i++)
> ? ? ?{
> ? ? ? ?use_operand_p imm, old_imm;
> ? ? ? ?imm = gimple_phi_arg_imm_use_ptr (new_phi, i);
> ! ? ? ? old_imm = gimple_phi_arg_imm_use_ptr (*phi, i);
> ? ? ? ?imm->use = gimple_phi_arg_def_ptr (new_phi, i);
> ? ? ? ?relink_imm_use_stmt (imm, old_imm, new_phi);
> ? ? ?}
> --- 269,297 ----
> ?/* Resize an existing PHI node. ?The only way is up. ?Return the
> ? ? possibly relocated phi. ?*/
>
> ! static gimple
> ! resize_phi_node (gimple phi, size_t len)
> ?{
> ? ?size_t old_size, i;
> ? ?gimple new_phi;
>
> ! ? gcc_assert (len > gimple_phi_capacity (phi));
>
> ? ?/* The garbage collector will not look at the PHI node beyond the
> ? ? ? first PHI_NUM_ARGS elements. ?Therefore, all we have to copy is a
> ? ? ? portion of the PHI node currently in use. ?*/
> ? ?old_size = sizeof (struct gimple_statement_phi)
> ! ? ? ? ? ? ?+ (gimple_phi_num_args (phi) - 1) * sizeof (struct phi_arg_d);
>
> ? ?new_phi = allocate_phi_node (len);
>
> ! ? memcpy (new_phi, phi, old_size);
>
> ? ?for (i = 0; i < gimple_phi_num_args (new_phi); i++)
> ? ? ?{
> ? ? ? ?use_operand_p imm, old_imm;
> ? ? ? ?imm = gimple_phi_arg_imm_use_ptr (new_phi, i);
> ! ? ? ? old_imm = gimple_phi_arg_imm_use_ptr (phi, i);
> ? ? ? ?imm->use = gimple_phi_arg_def_ptr (new_phi, i);
> ? ? ? ?relink_imm_use_stmt (imm, old_imm, new_phi);
> ? ? ?}
> *************** resize_phi_node (gimple *phi, size_t len
> *** 310,316 ****
> ? ? ? ?imm->loc.stmt = new_phi;
> ? ? ?}
>
> ! ? *phi = new_phi;
> ?}
>
> ?/* Reserve PHI arguments for a new edge to basic block BB. ?*/
> --- 310,316 ----
> ? ? ? ?imm->loc.stmt = new_phi;
> ? ? ?}
>
> ! ? return new_phi;
> ?}
>
> ?/* Reserve PHI arguments for a new edge to basic block BB. ?*/
> *************** reserve_phi_args_for_new_edge (basic_blo
> *** 324,341 ****
>
> ? ?for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
> ? ? ?{
> ! ? ? ? gimple *loc = gsi_stmt_ptr (&gsi);
>
> ! ? ? ? if (len > gimple_phi_capacity (*loc))
> ? ? ? ?{
> ! ? ? ? ? gimple old_phi = *loc;
> !
> ! ? ? ? ? resize_phi_node (loc, cap);
>
> ? ? ? ? ?/* The result of the PHI is defined by this PHI node. ?*/
> ! ? ? ? ? SSA_NAME_DEF_STMT (gimple_phi_result (*loc)) = *loc;
>
> ! ? ? ? ? release_phi_node (old_phi);
> ? ? ? ?}
>
> ? ? ? ?/* We represent a "missing PHI argument" by placing NULL_TREE in
> --- 324,341 ----
>
> ? ?for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
> ? ? ?{
> ! ? ? ? gimple stmt = gsi_stmt (gsi);
>
> ! ? ? ? if (len > gimple_phi_capacity (stmt))
> ? ? ? ?{
> ! ? ? ? ? gimple new_phi = resize_phi_node (stmt, cap);
>
> ? ? ? ? ?/* The result of the PHI is defined by this PHI node. ?*/
> ! ? ? ? ? SSA_NAME_DEF_STMT (gimple_phi_result (new_phi)) = new_phi;
> ! ? ? ? ? gsi_set_stmt (&gsi, new_phi);
>
> ! ? ? ? ? release_phi_node (stmt);
> ! ? ? ? ? stmt = new_phi;
> ? ? ? ?}
>
> ? ? ? ?/* We represent a "missing PHI argument" by placing NULL_TREE in
> *************** reserve_phi_args_for_new_edge (basic_blo
> *** 345,353 ****
> ? ? ? ? example, the loop optimizer duplicates several basic blocks,
> ? ? ? ? redirects edges, and then fixes up PHI arguments later in
> ? ? ? ? batch. ?*/
> ! ? ? ? SET_PHI_ARG_DEF (*loc, len - 1, NULL_TREE);
>
> ! ? ? ? (*loc)->gimple_phi.nargs++;
> ? ? ?}
> ?}
>
> --- 345,353 ----
> ? ? ? ? example, the loop optimizer duplicates several basic blocks,
> ? ? ? ? redirects edges, and then fixes up PHI arguments later in
> ? ? ? ? batch. ?*/
> ! ? ? ? SET_PHI_ARG_DEF (stmt, len - 1, NULL_TREE);
>
> ! ? ? ? stmt->gimple_phi.nargs++;
> ? ? ?}
> ?}
>
> Index: omp-low.c
> ===================================================================
> *** omp-low.c.orig ? ? ?2012-05-01 22:43:31.000000000 +0200
> --- omp-low.c ? 2012-05-02 01:53:33.000000000 +0200
> *************** scan_omp_op (tree *tp, omp_context *ctx)
> *** 158,164 ****
> ? ?return walk_tree (tp, scan_omp_1_op, &wi, NULL);
> ?}
>
> ! static void lower_omp (gimple_seq, omp_context *);
> ?static tree lookup_decl_in_outer_ctx (tree, omp_context *);
> ?static tree maybe_lookup_decl_in_outer_ctx (tree, omp_context *);
>
> --- 158,164 ----
> ? ?return walk_tree (tp, scan_omp_1_op, &wi, NULL);
> ?}
>
> ! static void lower_omp (gimple_seq *, omp_context *);
> ?static tree lookup_decl_in_outer_ctx (tree, omp_context *);
> ?static tree maybe_lookup_decl_in_outer_ctx (tree, omp_context *);
>
> *************** static void
> *** 2229,2242 ****
> ?lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist,
> ? ? ? ? ? ? ? ? ? ? ? ? omp_context *ctx)
> ?{
> - ? gimple_stmt_iterator diter;
> ? ?tree c, dtor, copyin_seq, x, ptr;
> ? ?bool copyin_by_ref = false;
> ? ?bool lastprivate_firstprivate = false;
> ? ?int pass;
>
> - ? *dlist = gimple_seq_alloc ();
> - ? diter = gsi_start (*dlist);
> ? ?copyin_seq = NULL;
>
> ? ?/* Do all the fixed sized types in the first pass, and the variable sized
> --- 2229,2239 ----
> *************** lower_rec_input_clauses (tree clauses, g
> *** 2425,2431 ****
>
> ? ? ? ? ? ? ? ? ?dtor = x;
> ? ? ? ? ? ? ? ? ?gimplify_stmt (&dtor, &tseq);
> ! ? ? ? ? ? ? ? ? gsi_insert_seq_before (&diter, tseq, GSI_SAME_STMT);
> ? ? ? ? ? ? ? ?}
> ? ? ? ? ? ? ?break;
>
> --- 2422,2428 ----
>
> ? ? ? ? ? ? ? ? ?dtor = x;
> ? ? ? ? ? ? ? ? ?gimplify_stmt (&dtor, &tseq);
> ! ? ? ? ? ? ? ? ? gimple_seq_add_seq (dlist, tseq);
> ? ? ? ? ? ? ? ?}
> ? ? ? ? ? ? ?break;
>
> *************** lower_rec_input_clauses (tree clauses, g
> *** 2468,2474 ****
> ? ? ? ? ? ? ? ? ? ?x = build_fold_addr_expr_loc (clause_loc, x);
> ? ? ? ? ? ? ? ? ?SET_DECL_VALUE_EXPR (placeholder, x);
> ? ? ? ? ? ? ? ? ?DECL_HAS_VALUE_EXPR_P (placeholder) = 1;
> ! ? ? ? ? ? ? ? ? lower_omp (OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c), ctx);
> ? ? ? ? ? ? ? ? ?gimple_seq_add_seq (ilist,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c));
> ? ? ? ? ? ? ? ? ?OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c) = NULL;
> --- 2465,2471 ----
> ? ? ? ? ? ? ? ? ? ?x = build_fold_addr_expr_loc (clause_loc, x);
> ? ? ? ? ? ? ? ? ?SET_DECL_VALUE_EXPR (placeholder, x);
> ? ? ? ? ? ? ? ? ?DECL_HAS_VALUE_EXPR_P (placeholder) = 1;
> ! ? ? ? ? ? ? ? ? lower_omp (&OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c), ctx);
> ? ? ? ? ? ? ? ? ?gimple_seq_add_seq (ilist,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c));
> ? ? ? ? ? ? ? ? ?OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c) = NULL;
> *************** lower_lastprivate_clauses (tree clauses,
> *** 2572,2578 ****
>
> ? ? ? ? ?if (OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c))
> ? ? ? ? ? ?{
> ! ? ? ? ? ? ? lower_omp (OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c), ctx);
> ? ? ? ? ? ? ?gimple_seq_add_seq (stmt_list,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c));
> ? ? ? ? ? ?}
> --- 2569,2575 ----
>
> ? ? ? ? ?if (OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c))
> ? ? ? ? ? ?{
> ! ? ? ? ? ? ? lower_omp (&OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c), ctx);
> ? ? ? ? ? ? ?gimple_seq_add_seq (stmt_list,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c));
> ? ? ? ? ? ?}
> *************** lower_reduction_clauses (tree clauses, g
> *** 2676,2682 ****
> ? ? ? ? ? ?ref = build_fold_addr_expr_loc (clause_loc, ref);
> ? ? ? ? ?SET_DECL_VALUE_EXPR (placeholder, ref);
> ? ? ? ? ?DECL_HAS_VALUE_EXPR_P (placeholder) = 1;
> ! ? ? ? ? lower_omp (OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c), ctx);
> ? ? ? ? ?gimple_seq_add_seq (&sub_seq, OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c));
> ? ? ? ? ?OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c) = NULL;
> ? ? ? ? ?OMP_CLAUSE_REDUCTION_PLACEHOLDER (c) = NULL;
> --- 2673,2679 ----
> ? ? ? ? ? ?ref = build_fold_addr_expr_loc (clause_loc, ref);
> ? ? ? ? ?SET_DECL_VALUE_EXPR (placeholder, ref);
> ? ? ? ? ?DECL_HAS_VALUE_EXPR_P (placeholder) = 1;
> ! ? ? ? ? lower_omp (&OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c), ctx);
> ? ? ? ? ?gimple_seq_add_seq (&sub_seq, OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c));
> ? ? ? ? ?OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c) = NULL;
> ? ? ? ? ?OMP_CLAUSE_REDUCTION_PLACEHOLDER (c) = NULL;
> *************** expand_omp_taskreg (struct omp_region *r
> *** 3499,3505 ****
> ? ? ? ? ? ?&& !DECL_EXTERNAL (t))
> ? ? ? ? ?varpool_finalize_decl (t);
> ? ? ? ?DECL_SAVED_TREE (child_fn) = NULL;
> ! ? ? ? gimple_set_body (child_fn, bb_seq (single_succ (entry_bb)));
> ? ? ? ?TREE_USED (block) = 1;
>
> ? ? ? ?/* Reset DECL_CONTEXT on function arguments. ?*/
> --- 3496,3503 ----
> ? ? ? ? ? ?&& !DECL_EXTERNAL (t))
> ? ? ? ? ?varpool_finalize_decl (t);
> ? ? ? ?DECL_SAVED_TREE (child_fn) = NULL;
> ! ? ? ? /* We'll create a CFG for child_fn, so no gimple body is needed. ?*/
> ! ? ? ? gimple_set_body (child_fn, NULL);
> ? ? ? ?TREE_USED (block) = 1;
>
> ? ? ? ?/* Reset DECL_CONTEXT on function arguments. ?*/
> *************** lower_omp_sections (gimple_stmt_iterator
> *** 5787,5795 ****
> ?{
> ? ?tree block, control;
> ? ?gimple_stmt_iterator tgsi;
> - ? unsigned i, len;
> ? ?gimple stmt, new_stmt, bind, t;
> ! ? gimple_seq ilist, dlist, olist, new_body, body;
> ? ?struct gimplify_ctx gctx;
>
> ? ?stmt = gsi_stmt (*gsi_p);
> --- 5785,5792 ----
> ?{
> ? ?tree block, control;
> ? ?gimple_stmt_iterator tgsi;
> ? ?gimple stmt, new_stmt, bind, t;
> ! ? gimple_seq ilist, dlist, olist, new_body;
> ? ?struct gimplify_ctx gctx;
>
> ? ?stmt = gsi_stmt (*gsi_p);
> *************** lower_omp_sections (gimple_stmt_iterator
> *** 5801,5813 ****
> ? ?lower_rec_input_clauses (gimple_omp_sections_clauses (stmt),
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? &ilist, &dlist, ctx);
>
> ! ? tgsi = gsi_start (gimple_omp_body (stmt));
> ! ? for (len = 0; !gsi_end_p (tgsi); len++, gsi_next (&tgsi))
> ! ? ? continue;
> !
> ! ? tgsi = gsi_start (gimple_omp_body (stmt));
> ! ? body = NULL;
> ! ? for (i = 0; i < len; i++, gsi_next (&tgsi))
> ? ? ?{
> ? ? ? ?omp_context *sctx;
> ? ? ? ?gimple sec_start;
> --- 5798,5807 ----
> ? ?lower_rec_input_clauses (gimple_omp_sections_clauses (stmt),
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? &ilist, &dlist, ctx);
>
> ! ? new_body = gimple_omp_body (stmt);
> ! ? gimple_omp_set_body (stmt, NULL);
> ! ? tgsi = gsi_start (new_body);
> ! ? for (; !gsi_end_p (tgsi); gsi_next (&tgsi))
> ? ? ?{
> ? ? ? ?omp_context *sctx;
> ? ? ? ?gimple sec_start;
> *************** lower_omp_sections (gimple_stmt_iterator
> *** 5816,5847 ****
> ? ? ? ?sctx = maybe_lookup_ctx (sec_start);
> ? ? ? ?gcc_assert (sctx);
>
> ! ? ? ? gimple_seq_add_stmt (&body, sec_start);
> !
> ! ? ? ? lower_omp (gimple_omp_body (sec_start), sctx);
> ! ? ? ? gimple_seq_add_seq (&body, gimple_omp_body (sec_start));
> ? ? ? ?gimple_omp_set_body (sec_start, NULL);
>
> ! ? ? ? if (i == len - 1)
> ? ? ? ?{
> ? ? ? ? ?gimple_seq l = NULL;
> ? ? ? ? ?lower_lastprivate_clauses (gimple_omp_sections_clauses (stmt), NULL,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? &l, ctx);
> ! ? ? ? ? gimple_seq_add_seq (&body, l);
> ? ? ? ? ?gimple_omp_section_set_last (sec_start);
> ? ? ? ?}
>
> ! ? ? ? gimple_seq_add_stmt (&body, gimple_build_omp_return (false));
> ? ? ?}
>
> ? ?block = make_node (BLOCK);
> ! ? bind = gimple_build_bind (NULL, body, block);
>
> ? ?olist = NULL;
> ? ?lower_reduction_clauses (gimple_omp_sections_clauses (stmt), &olist, ctx);
>
> ? ?block = make_node (BLOCK);
> ? ?new_stmt = gimple_build_bind (NULL, NULL, block);
>
> ? ?pop_gimplify_context (new_stmt);
> ? ?gimple_bind_append_vars (new_stmt, ctx->block_vars);
> --- 5810,5842 ----
> ? ? ? ?sctx = maybe_lookup_ctx (sec_start);
> ? ? ? ?gcc_assert (sctx);
>
> ! ? ? ? lower_omp (gimple_omp_body_ptr (sec_start), sctx);
> ! ? ? ? gsi_insert_seq_after (&tgsi, gimple_omp_body (sec_start),
> ! ? ? ? ? ? ? ? ? ? ? ? ? ? GSI_CONTINUE_LINKING);
> ? ? ? ?gimple_omp_set_body (sec_start, NULL);
>
> ! ? ? ? if (gsi_one_before_end_p (tgsi))
> ? ? ? ?{
> ? ? ? ? ?gimple_seq l = NULL;
> ? ? ? ? ?lower_lastprivate_clauses (gimple_omp_sections_clauses (stmt), NULL,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? &l, ctx);
> ! ? ? ? ? gsi_insert_seq_after (&tgsi, l, GSI_CONTINUE_LINKING);
> ? ? ? ? ?gimple_omp_section_set_last (sec_start);
> ? ? ? ?}
>
> ! ? ? ? gsi_insert_after (&tgsi, gimple_build_omp_return (false),
> ! ? ? ? ? ? ? ? ? ? ? ? GSI_CONTINUE_LINKING);
> ? ? ?}
>
> ? ?block = make_node (BLOCK);
> ! ? bind = gimple_build_bind (NULL, new_body, block);
>
> ? ?olist = NULL;
> ? ?lower_reduction_clauses (gimple_omp_sections_clauses (stmt), &olist, ctx);
>
> ? ?block = make_node (BLOCK);
> ? ?new_stmt = gimple_build_bind (NULL, NULL, block);
> + ? gsi_replace (gsi_p, new_stmt, true);
>
> ? ?pop_gimplify_context (new_stmt);
> ? ?gimple_bind_append_vars (new_stmt, ctx->block_vars);
> *************** lower_omp_sections (gimple_stmt_iterator
> *** 5871,5879 ****
> ? ?gimple_seq_add_stmt (&new_body, t);
>
> ? ?gimple_bind_set_body (new_stmt, new_body);
> - ? gimple_omp_set_body (stmt, NULL);
> -
> - ? gsi_replace (gsi_p, new_stmt, true);
> ?}
>
>
> --- 5866,5871 ----
> *************** lower_omp_single (gimple_stmt_iterator *
> *** 6006,6015 ****
>
> ? ?push_gimplify_context (&gctx);
>
> ? ?bind_body = NULL;
> ? ?lower_rec_input_clauses (gimple_omp_single_clauses (single_stmt),
> ? ? ? ? ? ? ? ? ? ? ? ? ? &bind_body, &dlist, ctx);
> ! ? lower_omp (gimple_omp_body (single_stmt), ctx);
>
> ? ?gimple_seq_add_stmt (&bind_body, single_stmt);
>
> --- 5998,6011 ----
>
> ? ?push_gimplify_context (&gctx);
>
> + ? block = make_node (BLOCK);
> + ? bind = gimple_build_bind (NULL, NULL, block);
> + ? gsi_replace (gsi_p, bind, true);
> ? ?bind_body = NULL;
> + ? dlist = NULL;
> ? ?lower_rec_input_clauses (gimple_omp_single_clauses (single_stmt),
> ? ? ? ? ? ? ? ? ? ? ? ? ? &bind_body, &dlist, ctx);
> ! ? lower_omp (gimple_omp_body_ptr (single_stmt), ctx);
>
> ? ?gimple_seq_add_stmt (&bind_body, single_stmt);
>
> *************** lower_omp_single (gimple_stmt_iterator *
> *** 6028,6042 ****
> ? ? ? ? ?(!!find_omp_clause (gimple_omp_single_clauses (single_stmt),
> ? ? ? ? ? ? ? ? ? ? ? ? ? ?OMP_CLAUSE_NOWAIT));
> ? ?gimple_seq_add_stmt (&bind_body, t);
> !
> ! ? block = make_node (BLOCK);
> ! ? bind = gimple_build_bind (NULL, bind_body, block);
>
> ? ?pop_gimplify_context (bind);
>
> ? ?gimple_bind_append_vars (bind, ctx->block_vars);
> ? ?BLOCK_VARS (block) = ctx->block_vars;
> - ? gsi_replace (gsi_p, bind, true);
> ? ?if (BLOCK_VARS (block))
> ? ? ?TREE_USED (block) = 1;
> ?}
> --- 6024,6035 ----
> ? ? ? ? ?(!!find_omp_clause (gimple_omp_single_clauses (single_stmt),
> ? ? ? ? ? ? ? ? ? ? ? ? ? ?OMP_CLAUSE_NOWAIT));
> ? ?gimple_seq_add_stmt (&bind_body, t);
> ! ? gimple_bind_set_body (bind, bind_body);
>
> ? ?pop_gimplify_context (bind);
>
> ? ?gimple_bind_append_vars (bind, ctx->block_vars);
> ? ?BLOCK_VARS (block) = ctx->block_vars;
> ? ?if (BLOCK_VARS (block))
> ? ? ?TREE_USED (block) = 1;
> ?}
> *************** lower_omp_master (gimple_stmt_iterator *
> *** 6056,6063 ****
> ? ?push_gimplify_context (&gctx);
>
> ? ?block = make_node (BLOCK);
> ! ? bind = gimple_build_bind (NULL, gimple_seq_alloc_with_stmt (stmt),
> ! ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?block);
>
> ? ?bfn_decl = builtin_decl_explicit (BUILT_IN_OMP_GET_THREAD_NUM);
> ? ?x = build_call_expr_loc (loc, bfn_decl, 0);
> --- 6049,6057 ----
> ? ?push_gimplify_context (&gctx);
>
> ? ?block = make_node (BLOCK);
> ! ? bind = gimple_build_bind (NULL, NULL, block);
> ! ? gsi_replace (gsi_p, bind, true);
> ! ? gimple_bind_add_stmt (bind, stmt);
>
> ? ?bfn_decl = builtin_decl_explicit (BUILT_IN_OMP_GET_THREAD_NUM);
> ? ?x = build_call_expr_loc (loc, bfn_decl, 0);
> *************** lower_omp_master (gimple_stmt_iterator *
> *** 6067,6073 ****
> ? ?gimplify_and_add (x, &tseq);
> ? ?gimple_bind_add_seq (bind, tseq);
>
> ! ? lower_omp (gimple_omp_body (stmt), ctx);
> ? ?gimple_omp_set_body (stmt, maybe_catch_exception (gimple_omp_body (stmt)));
> ? ?gimple_bind_add_seq (bind, gimple_omp_body (stmt));
> ? ?gimple_omp_set_body (stmt, NULL);
> --- 6061,6067 ----
> ? ?gimplify_and_add (x, &tseq);
> ? ?gimple_bind_add_seq (bind, tseq);
>
> ! ? lower_omp (gimple_omp_body_ptr (stmt), ctx);
> ? ?gimple_omp_set_body (stmt, maybe_catch_exception (gimple_omp_body (stmt)));
> ? ?gimple_bind_add_seq (bind, gimple_omp_body (stmt));
> ? ?gimple_omp_set_body (stmt, NULL);
> *************** lower_omp_master (gimple_stmt_iterator *
> *** 6080,6086 ****
>
> ? ?gimple_bind_append_vars (bind, ctx->block_vars);
> ? ?BLOCK_VARS (block) = ctx->block_vars;
> - ? gsi_replace (gsi_p, bind, true);
> ?}
>
>
> --- 6074,6079 ----
> *************** lower_omp_ordered (gimple_stmt_iterator
> *** 6096,6109 ****
> ? ?push_gimplify_context (&gctx);
>
> ? ?block = make_node (BLOCK);
> ! ? bind = gimple_build_bind (NULL, gimple_seq_alloc_with_stmt (stmt),
> ! ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?block);
>
> ? ?x = gimple_build_call (builtin_decl_explicit (BUILT_IN_GOMP_ORDERED_START),
> ? ? ? ? ? ? ? ? ? ? ? ? 0);
> ? ?gimple_bind_add_stmt (bind, x);
>
> ! ? lower_omp (gimple_omp_body (stmt), ctx);
> ? ?gimple_omp_set_body (stmt, maybe_catch_exception (gimple_omp_body (stmt)));
> ? ?gimple_bind_add_seq (bind, gimple_omp_body (stmt));
> ? ?gimple_omp_set_body (stmt, NULL);
> --- 6089,6103 ----
> ? ?push_gimplify_context (&gctx);
>
> ? ?block = make_node (BLOCK);
> ! ? bind = gimple_build_bind (NULL, NULL, block);
> ! ? gsi_replace (gsi_p, bind, true);
> ! ? gimple_bind_add_stmt (bind, stmt);
>
> ? ?x = gimple_build_call (builtin_decl_explicit (BUILT_IN_GOMP_ORDERED_START),
> ? ? ? ? ? ? ? ? ? ? ? ? 0);
> ? ?gimple_bind_add_stmt (bind, x);
>
> ! ? lower_omp (gimple_omp_body_ptr (stmt), ctx);
> ? ?gimple_omp_set_body (stmt, maybe_catch_exception (gimple_omp_body (stmt)));
> ? ?gimple_bind_add_seq (bind, gimple_omp_body (stmt));
> ? ?gimple_omp_set_body (stmt, NULL);
> *************** lower_omp_ordered (gimple_stmt_iterator
> *** 6117,6123 ****
>
> ? ?gimple_bind_append_vars (bind, ctx->block_vars);
> ? ?BLOCK_VARS (block) = gimple_bind_vars (bind);
> - ? gsi_replace (gsi_p, bind, true);
> ?}
>
>
> --- 6111,6116 ----
> *************** lower_omp_critical (gimple_stmt_iterator
> *** 6193,6205 ****
> ? ?push_gimplify_context (&gctx);
>
> ? ?block = make_node (BLOCK);
> ! ? bind = gimple_build_bind (NULL, gimple_seq_alloc_with_stmt (stmt), block);
>
> ? ?tbody = gimple_bind_body (bind);
> ? ?gimplify_and_add (lock, &tbody);
> ? ?gimple_bind_set_body (bind, tbody);
>
> ! ? lower_omp (gimple_omp_body (stmt), ctx);
> ? ?gimple_omp_set_body (stmt, maybe_catch_exception (gimple_omp_body (stmt)));
> ? ?gimple_bind_add_seq (bind, gimple_omp_body (stmt));
> ? ?gimple_omp_set_body (stmt, NULL);
> --- 6186,6200 ----
> ? ?push_gimplify_context (&gctx);
>
> ? ?block = make_node (BLOCK);
> ! ? bind = gimple_build_bind (NULL, NULL, block);
> ! ? gsi_replace (gsi_p, bind, true);
> ! ? gimple_bind_add_stmt (bind, stmt);
>
> ? ?tbody = gimple_bind_body (bind);
> ? ?gimplify_and_add (lock, &tbody);
> ? ?gimple_bind_set_body (bind, tbody);
>
> ! ? lower_omp (gimple_omp_body_ptr (stmt), ctx);
> ? ?gimple_omp_set_body (stmt, maybe_catch_exception (gimple_omp_body (stmt)));
> ? ?gimple_bind_add_seq (bind, gimple_omp_body (stmt));
> ? ?gimple_omp_set_body (stmt, NULL);
> *************** lower_omp_critical (gimple_stmt_iterator
> *** 6213,6219 ****
> ? ?pop_gimplify_context (bind);
> ? ?gimple_bind_append_vars (bind, ctx->block_vars);
> ? ?BLOCK_VARS (block) = gimple_bind_vars (bind);
> - ? gsi_replace (gsi_p, bind, true);
> ?}
>
>
> --- 6208,6213 ----
> *************** lower_omp_for (gimple_stmt_iterator *gsi
> *** 6281,6291 ****
>
> ? ?push_gimplify_context (&gctx);
>
> ! ? lower_omp (gimple_omp_for_pre_body (stmt), ctx);
> ! ? lower_omp (gimple_omp_body (stmt), ctx);
>
> ? ?block = make_node (BLOCK);
> ? ?new_stmt = gimple_build_bind (NULL, NULL, block);
>
> ? ?/* Move declaration of temporaries in the loop body before we make
> ? ? ? it go away. ?*/
> --- 6275,6289 ----
>
> ? ?push_gimplify_context (&gctx);
>
> ! ? lower_omp (gimple_omp_for_pre_body_ptr (stmt), ctx);
> ! ? lower_omp (gimple_omp_body_ptr (stmt), ctx);
>
> ? ?block = make_node (BLOCK);
> ? ?new_stmt = gimple_build_bind (NULL, NULL, block);
> + ? /* Replace at gsi right away, so that 'stmt' is no member
> + ? ? ?of a sequence anymore as we're going to add to to a different
> + ? ? ?one below. ?*/
> + ? gsi_replace (gsi_p, new_stmt, true);
>
> ? ?/* Move declaration of temporaries in the loop body before we make
> ? ? ? it go away. ?*/
> *************** lower_omp_for (gimple_stmt_iterator *gsi
> *** 6355,6361 ****
> ? ?gimple_bind_set_body (new_stmt, body);
> ? ?gimple_omp_set_body (stmt, NULL);
> ? ?gimple_omp_for_set_pre_body (stmt, NULL);
> - ? gsi_replace (gsi_p, new_stmt, true);
> ?}
>
> ?/* Callback for walk_stmts. ?Check if the current statement only contains
> --- 6353,6358 ----
> *************** lower_omp_taskreg (gimple_stmt_iterator
> *** 6708,6714 ****
> ? ?par_olist = NULL;
> ? ?par_ilist = NULL;
> ? ?lower_rec_input_clauses (clauses, &par_ilist, &par_olist, ctx);
> ! ? lower_omp (par_body, ctx);
> ? ?if (gimple_code (stmt) == GIMPLE_OMP_PARALLEL)
> ? ? ?lower_reduction_clauses (clauses, &par_olist, ctx);
>
> --- 6705,6711 ----
> ? ?par_olist = NULL;
> ? ?par_ilist = NULL;
> ? ?lower_rec_input_clauses (clauses, &par_ilist, &par_olist, ctx);
> ! ? lower_omp (&par_body, ctx);
> ? ?if (gimple_code (stmt) == GIMPLE_OMP_PARALLEL)
> ? ? ?lower_reduction_clauses (clauses, &par_olist, ctx);
>
> *************** lower_omp_taskreg (gimple_stmt_iterator
> *** 6754,6768 ****
> ? ?gimple_omp_set_body (stmt, new_body);
>
> ? ?bind = gimple_build_bind (NULL, NULL, gimple_bind_block (par_bind));
> - ? gimple_bind_add_stmt (bind, stmt);
> - ? if (ilist || olist)
> - ? ? {
> - ? ? ? gimple_seq_add_stmt (&ilist, bind);
> - ? ? ? gimple_seq_add_seq (&ilist, olist);
> - ? ? ? bind = gimple_build_bind (NULL, ilist, NULL);
> - ? ? }
> -
> ? ?gsi_replace (gsi_p, bind, true);
>
> ? ?pop_gimplify_context (NULL);
> ?}
> --- 6751,6760 ----
> ? ?gimple_omp_set_body (stmt, new_body);
>
> ? ?bind = gimple_build_bind (NULL, NULL, gimple_bind_block (par_bind));
> ? ?gsi_replace (gsi_p, bind, true);
> + ? gimple_bind_add_seq (bind, ilist);
> + ? gimple_bind_add_stmt (bind, stmt);
> + ? gimple_bind_add_seq (bind, olist);
>
> ? ?pop_gimplify_context (NULL);
> ?}
> *************** lower_omp_1 (gimple_stmt_iterator *gsi_p
> *** 6827,6843 ****
> ? ? ? ?gimple_regimplify_operands (stmt, gsi_p);
> ? ? ? ?break;
> ? ? ?case GIMPLE_CATCH:
> ! ? ? ? lower_omp (gimple_catch_handler (stmt), ctx);
> ? ? ? ?break;
> ? ? ?case GIMPLE_EH_FILTER:
> ! ? ? ? lower_omp (gimple_eh_filter_failure (stmt), ctx);
> ? ? ? ?break;
> ? ? ?case GIMPLE_TRY:
> ! ? ? ? lower_omp (gimple_try_eval (stmt), ctx);
> ! ? ? ? lower_omp (gimple_try_cleanup (stmt), ctx);
> ? ? ? ?break;
> ? ? ?case GIMPLE_BIND:
> ! ? ? ? lower_omp (gimple_bind_body (stmt), ctx);
> ? ? ? ?break;
> ? ? ?case GIMPLE_OMP_PARALLEL:
> ? ? ?case GIMPLE_OMP_TASK:
> --- 6819,6835 ----
> ? ? ? ?gimple_regimplify_operands (stmt, gsi_p);
> ? ? ? ?break;
> ? ? ?case GIMPLE_CATCH:
> ! ? ? ? lower_omp (gimple_catch_handler_ptr (stmt), ctx);
> ? ? ? ?break;
> ? ? ?case GIMPLE_EH_FILTER:
> ! ? ? ? lower_omp (gimple_eh_filter_failure_ptr (stmt), ctx);
> ? ? ? ?break;
> ? ? ?case GIMPLE_TRY:
> ! ? ? ? lower_omp (gimple_try_eval_ptr (stmt), ctx);
> ! ? ? ? lower_omp (gimple_try_cleanup_ptr (stmt), ctx);
> ? ? ? ?break;
> ? ? ?case GIMPLE_BIND:
> ! ? ? ? lower_omp (gimple_bind_body_ptr (stmt), ctx);
> ? ? ? ?break;
> ? ? ?case GIMPLE_OMP_PARALLEL:
> ? ? ?case GIMPLE_OMP_TASK:
> *************** lower_omp_1 (gimple_stmt_iterator *gsi_p
> *** 6890,6900 ****
> ?}
>
> ?static void
> ! lower_omp (gimple_seq body, omp_context *ctx)
> ?{
> ? ?location_t saved_location = input_location;
> ! ? gimple_stmt_iterator gsi = gsi_start (body);
> ! ? for (gsi = gsi_start (body); !gsi_end_p (gsi); gsi_next (&gsi))
> ? ? ?lower_omp_1 (&gsi, ctx);
> ? ?input_location = saved_location;
> ?}
> --- 6882,6892 ----
> ?}
>
> ?static void
> ! lower_omp (gimple_seq *body, omp_context *ctx)
> ?{
> ? ?location_t saved_location = input_location;
> ! ? gimple_stmt_iterator gsi;
> ! ? for (gsi = gsi_start (*body); !gsi_end_p (gsi); gsi_next (&gsi))
> ? ? ?lower_omp_1 (&gsi, ctx);
> ? ?input_location = saved_location;
> ?}
> *************** execute_lower_omp (void)
> *** 6924,6930 ****
>
> ? ? ? ?if (task_shared_vars)
> ? ? ? ?push_gimplify_context (&gctx);
> ! ? ? ? lower_omp (body, NULL);
> ? ? ? ?if (task_shared_vars)
> ? ? ? ?pop_gimplify_context (NULL);
> ? ? ?}
> --- 6916,6922 ----
>
> ? ? ? ?if (task_shared_vars)
> ? ? ? ?push_gimplify_context (&gctx);
> ! ? ? ? lower_omp (&body, NULL);
> ? ? ? ?if (task_shared_vars)
> ? ? ? ?pop_gimplify_context (NULL);
> ? ? ?}
> *************** diagnose_sb_2 (gimple_stmt_iterator *gsi
> *** 7102,7108 ****
> ? ? ?case GIMPLE_OMP_ORDERED:
> ? ? ?case GIMPLE_OMP_CRITICAL:
> ? ? ? ?wi->info = stmt;
> ! ? ? ? walk_gimple_seq (gimple_omp_body (stmt), diagnose_sb_2, NULL, wi);
> ? ? ? ?wi->info = context;
> ? ? ? ?break;
>
> --- 7094,7100 ----
> ? ? ?case GIMPLE_OMP_ORDERED:
> ? ? ?case GIMPLE_OMP_CRITICAL:
> ? ? ? ?wi->info = stmt;
> ! ? ? ? walk_gimple_seq_mod (gimple_omp_body_ptr (stmt), diagnose_sb_2, NULL, wi);
> ? ? ? ?wi->info = context;
> ? ? ? ?break;
>
> *************** diagnose_sb_2 (gimple_stmt_iterator *gsi
> *** 7110,7118 ****
> ? ? ? ?wi->info = stmt;
> ? ? ? ?/* gimple_omp_for_{index,initial,final} are all DECLs; no need to
> ? ? ? ? walk them. ?*/
> ! ? ? ? walk_gimple_seq (gimple_omp_for_pre_body (stmt),
> ! ? ? ? ? ? ? ? ? ? ? ?diagnose_sb_2, NULL, wi);
> ! ? ? ? walk_gimple_seq (gimple_omp_body (stmt), diagnose_sb_2, NULL, wi);
> ? ? ? ?wi->info = context;
> ? ? ? ?break;
>
> --- 7102,7110 ----
> ? ? ? ?wi->info = stmt;
> ? ? ? ?/* gimple_omp_for_{index,initial,final} are all DECLs; no need to
> ? ? ? ? walk them. ?*/
> ! ? ? ? walk_gimple_seq_mod (gimple_omp_for_pre_body_ptr (stmt),
> ! ? ? ? ? ? ? ? ? ? ? ? ? ?diagnose_sb_2, NULL, wi);
> ! ? ? ? walk_gimple_seq_mod (gimple_omp_body_ptr (stmt), diagnose_sb_2, NULL, wi);
> ? ? ? ?wi->info = context;
> ? ? ? ?break;
>
> *************** diagnose_omp_structured_block_errors (vo
> *** 7185,7191 ****
>
> ? ?memset (&wi, 0, sizeof (wi));
> ? ?wi.want_locations = true;
> ! ? walk_gimple_seq (body, diagnose_sb_2, NULL, &wi);
>
> ? ?splay_tree_delete (all_labels);
> ? ?all_labels = NULL;
> --- 7177,7185 ----
>
> ? ?memset (&wi, 0, sizeof (wi));
> ? ?wi.want_locations = true;
> ! ? walk_gimple_seq_mod (&body, diagnose_sb_2, NULL, &wi);
> !
> ! ? gimple_set_body (current_function_decl, body);
>
> ? ?splay_tree_delete (all_labels);
> ? ?all_labels = NULL;
> Index: gimple-low.c
> ===================================================================
> *** gimple-low.c.orig ? 2012-05-01 22:43:31.000000000 +0200
> --- gimple-low.c ? ? ? ?2012-05-01 22:43:34.000000000 +0200
> *************** lower_function_body (void)
> *** 112,121 ****
> ? ?i = gsi_start (lowered_body);
> ? ?lower_gimple_bind (&i, &data);
>
> - ? /* Once the old body has been lowered, replace it with the new
> - ? ? ?lowered sequence. ?*/
> - ? gimple_set_body (current_function_decl, lowered_body);
> -
> ? ?i = gsi_last (lowered_body);
>
> ? ?/* If the function falls off the end, we need a null return statement.
> --- 112,117 ----
> *************** lower_function_body (void)
> *** 179,184 ****
> --- 175,184 ----
> ? ? ? ?gsi_insert_after (&i, x, GSI_CONTINUE_LINKING);
> ? ? ?}
>
> + ? /* Once the old body has been lowered, replace it with the new
> + ? ? ?lowered sequence. ?*/
> + ? gimple_set_body (current_function_decl, lowered_body);
> +
> ? ?gcc_assert (data.block == DECL_INITIAL (current_function_decl));
> ? ?BLOCK_SUBBLOCKS (data.block)
> ? ? ?= blocks_nreverse (BLOCK_SUBBLOCKS (data.block));
> *************** gimple_check_call_matching_types (gimple
> *** 305,315 ****
> ? ? do it explicitly. ?DATA is passed through the recursion. ?*/
>
> ?static void
> ! lower_sequence (gimple_seq seq, struct lower_data *data)
> ?{
> ? ?gimple_stmt_iterator gsi;
>
> ! ? for (gsi = gsi_start (seq); !gsi_end_p (gsi); )
> ? ? ?lower_stmt (&gsi, data);
> ?}
>
> --- 305,315 ----
> ? ? do it explicitly. ?DATA is passed through the recursion. ?*/
>
> ?static void
> ! lower_sequence (gimple_seq *seq, struct lower_data *data)
> ?{
> ? ?gimple_stmt_iterator gsi;
>
> ! ? for (gsi = gsi_start (*seq); !gsi_end_p (gsi); )
> ? ? ?lower_stmt (&gsi, data);
> ?}
>
> *************** lower_omp_directive (gimple_stmt_iterato
> *** 324,334 ****
>
> ? ?stmt = gsi_stmt (*gsi);
>
> ! ? lower_sequence (gimple_omp_body (stmt), data);
> ! ? gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
> ! ? gsi_insert_seq_before (gsi, gimple_omp_body (stmt), GSI_SAME_STMT);
> ? ?gimple_omp_set_body (stmt, NULL);
> ! ? gsi_remove (gsi, false);
> ?}
>
>
> --- 324,333 ----
>
> ? ?stmt = gsi_stmt (*gsi);
>
> ! ? lower_sequence (gimple_omp_body_ptr (stmt), data);
> ! ? gsi_insert_seq_after (gsi, gimple_omp_body (stmt), GSI_CONTINUE_LINKING);
> ? ?gimple_omp_set_body (stmt, NULL);
> ! ? gsi_next (gsi);
> ?}
>
>
> *************** lower_stmt (gimple_stmt_iterator *gsi, s
> *** 376,385 ****
> ? ? ?case GIMPLE_TRY:
> ? ? ? ?{
> ? ? ? ?bool try_cannot_fallthru;
> ! ? ? ? lower_sequence (gimple_try_eval (stmt), data);
> ? ? ? ?try_cannot_fallthru = data->cannot_fallthru;
> ? ? ? ?data->cannot_fallthru = false;
> ! ? ? ? lower_sequence (gimple_try_cleanup (stmt), data);
> ? ? ? ?/* See gimple_stmt_may_fallthru for the rationale. ?*/
> ? ? ? ?if (gimple_try_kind (stmt) == GIMPLE_TRY_FINALLY)
> ? ? ? ? ?{
> --- 375,384 ----
> ? ? ?case GIMPLE_TRY:
> ? ? ? ?{
> ? ? ? ?bool try_cannot_fallthru;
> ! ? ? ? lower_sequence (gimple_try_eval_ptr (stmt), data);
> ? ? ? ?try_cannot_fallthru = data->cannot_fallthru;
> ? ? ? ?data->cannot_fallthru = false;
> ! ? ? ? lower_sequence (gimple_try_cleanup_ptr (stmt), data);
> ? ? ? ?/* See gimple_stmt_may_fallthru for the rationale. ?*/
> ? ? ? ?if (gimple_try_kind (stmt) == GIMPLE_TRY_FINALLY)
> ? ? ? ? ?{
> *************** lower_stmt (gimple_stmt_iterator *gsi, s
> *** 392,408 ****
>
> ? ? ?case GIMPLE_CATCH:
> ? ? ? ?data->cannot_fallthru = false;
> ! ? ? ? lower_sequence (gimple_catch_handler (stmt), data);
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_EH_FILTER:
> ? ? ? ?data->cannot_fallthru = false;
> ! ? ? ? lower_sequence (gimple_eh_filter_failure (stmt), data);
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_EH_ELSE:
> ! ? ? ? lower_sequence (gimple_eh_else_n_body (stmt), data);
> ! ? ? ? lower_sequence (gimple_eh_else_e_body (stmt), data);
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_NOP:
> --- 391,407 ----
>
> ? ? ?case GIMPLE_CATCH:
> ? ? ? ?data->cannot_fallthru = false;
> ! ? ? ? lower_sequence (gimple_catch_handler_ptr (stmt), data);
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_EH_FILTER:
> ? ? ? ?data->cannot_fallthru = false;
> ! ? ? ? lower_sequence (gimple_eh_filter_failure_ptr (stmt), data);
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_EH_ELSE:
> ! ? ? ? lower_sequence (gimple_eh_else_n_body_ptr (stmt), data);
> ! ? ? ? lower_sequence (gimple_eh_else_e_body_ptr (stmt), data);
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_NOP:
> *************** lower_stmt (gimple_stmt_iterator *gsi, s
> *** 456,462 ****
> ? ? ? ?return;
>
> ? ? ?case GIMPLE_TRANSACTION:
> ! ? ? ? lower_sequence (gimple_transaction_body (stmt), data);
> ? ? ? ?break;
>
> ? ? ?default:
> --- 455,461 ----
> ? ? ? ?return;
>
> ? ? ?case GIMPLE_TRANSACTION:
> ! ? ? ? lower_sequence (gimple_transaction_body_ptr (stmt), data);
> ? ? ? ?break;
>
> ? ? ?default:
> *************** lower_gimple_bind (gimple_stmt_iterator
> *** 505,511 ****
> ? ? ?}
>
> ? ?record_vars (gimple_bind_vars (stmt));
> ! ? lower_sequence (gimple_bind_body (stmt), data);
>
> ? ?if (new_block)
> ? ? ?{
> --- 504,510 ----
> ? ? ?}
>
> ? ?record_vars (gimple_bind_vars (stmt));
> ! ? lower_sequence (gimple_bind_body_ptr (stmt), data);
>
> ? ?if (new_block)
> ? ? ?{
> *************** gimple_try_catch_may_fallthru (gimple st
> *** 585,591 ****
> ? ?if (gimple_seq_may_fallthru (gimple_try_eval (stmt)))
> ? ? ?return true;
>
> ! ? i = gsi_start (gimple_try_cleanup (stmt));
> ? ?switch (gimple_code (gsi_stmt (i)))
> ? ? ?{
> ? ? ?case GIMPLE_CATCH:
> --- 584,590 ----
> ? ?if (gimple_seq_may_fallthru (gimple_try_eval (stmt)))
> ? ? ?return true;
>
> ! ? i = gsi_start (*gimple_try_cleanup_ptr (stmt));
> ? ?switch (gimple_code (gsi_stmt (i)))
> ? ? ?{
> ? ? ?case GIMPLE_CATCH:
> Index: tree-nested.c
> ===================================================================
> *** tree-nested.c.orig ?2012-05-01 22:43:31.000000000 +0200
> --- tree-nested.c ? ? ? 2012-05-02 01:53:33.000000000 +0200
> *************** get_nl_goto_field (struct nesting_info *
> *** 577,594 ****
> ? ?return field;
> ?}
>
> ! /* Invoke CALLBACK on all statements of GIMPLE sequence SEQ. ?*/
>
> ?static void
> ?walk_body (walk_stmt_fn callback_stmt, walk_tree_fn callback_op,
> ! ? ? ? ? ?struct nesting_info *info, gimple_seq seq)
> ?{
> ? ?struct walk_stmt_info wi;
>
> ? ?memset (&wi, 0, sizeof (wi));
> ? ?wi.info = info;
> ? ?wi.val_only = true;
> ! ? walk_gimple_seq (seq, callback_stmt, callback_op, &wi);
> ?}
>
>
> --- 577,594 ----
> ? ?return field;
> ?}
>
> ! /* Invoke CALLBACK on all statements of GIMPLE sequence *PSEQ. ?*/
>
> ?static void
> ?walk_body (walk_stmt_fn callback_stmt, walk_tree_fn callback_op,
> ! ? ? ? ? ?struct nesting_info *info, gimple_seq *pseq)
> ?{
> ? ?struct walk_stmt_info wi;
>
> ? ?memset (&wi, 0, sizeof (wi));
> ? ?wi.info = info;
> ? ?wi.val_only = true;
> ! ? walk_gimple_seq_mod (pseq, callback_stmt, callback_op, &wi);
> ?}
>
>
> *************** static inline void
> *** 598,604 ****
> ?walk_function (walk_stmt_fn callback_stmt, walk_tree_fn callback_op,
> ? ? ? ? ? ? ? struct nesting_info *info)
> ?{
> ! ? walk_body (callback_stmt, callback_op, info, gimple_body (info->context));
> ?}
>
> ?/* Invoke CALLBACK on a GIMPLE_OMP_FOR's init, cond, incr and pre-body. ?*/
> --- 598,606 ----
> ?walk_function (walk_stmt_fn callback_stmt, walk_tree_fn callback_op,
> ? ? ? ? ? ? ? struct nesting_info *info)
> ?{
> ! ? gimple_seq body = gimple_body (info->context);
> ! ? walk_body (callback_stmt, callback_op, info, &body);
> ! ? gimple_set_body (info->context, body);
> ?}
>
> ?/* Invoke CALLBACK on a GIMPLE_OMP_FOR's init, cond, incr and pre-body. ?*/
> *************** walk_gimple_omp_for (gimple for_stmt,
> *** 613,619 ****
> ? ?tree t;
> ? ?size_t i;
>
> ! ? walk_body (callback_stmt, callback_op, info, gimple_omp_for_pre_body (for_stmt));
>
> ? ?seq = gimple_seq_alloc ();
> ? ?memset (&wi, 0, sizeof (wi));
> --- 615,621 ----
> ? ?tree t;
> ? ?size_t i;
>
> ! ? walk_body (callback_stmt, callback_op, info, gimple_omp_for_pre_body_ptr (for_stmt));
>
> ? ?seq = gimple_seq_alloc ();
> ? ?memset (&wi, 0, sizeof (wi));
> *************** convert_nonlocal_omp_clauses (tree *pcla
> *** 1136,1145 ****
> ? ? ? ? ? ? ? ?= info->context;
> ? ? ? ? ? ? ?walk_body (convert_nonlocal_reference_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? convert_nonlocal_reference_op, info,
> ! ? ? ? ? ? ? ? ? ? ? ? ?OMP_CLAUSE_REDUCTION_GIMPLE_INIT (clause));
> ? ? ? ? ? ? ?walk_body (convert_nonlocal_reference_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? convert_nonlocal_reference_op, info,
> ! ? ? ? ? ? ? ? ? ? ? ? ?OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (clause));
> ? ? ? ? ? ? ?DECL_CONTEXT (OMP_CLAUSE_REDUCTION_PLACEHOLDER (clause))
> ? ? ? ? ? ? ? ?= old_context;
> ? ? ? ? ? ?}
> --- 1138,1147 ----
> ? ? ? ? ? ? ? ?= info->context;
> ? ? ? ? ? ? ?walk_body (convert_nonlocal_reference_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? convert_nonlocal_reference_op, info,
> ! ? ? ? ? ? ? ? ? ? ? ? ?&OMP_CLAUSE_REDUCTION_GIMPLE_INIT (clause));
> ? ? ? ? ? ? ?walk_body (convert_nonlocal_reference_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? convert_nonlocal_reference_op, info,
> ! ? ? ? ? ? ? ? ? ? ? ? ?&OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (clause));
> ? ? ? ? ? ? ?DECL_CONTEXT (OMP_CLAUSE_REDUCTION_PLACEHOLDER (clause))
> ? ? ? ? ? ? ? ?= old_context;
> ? ? ? ? ? ?}
> *************** convert_nonlocal_omp_clauses (tree *pcla
> *** 1148,1154 ****
> ? ? ? ?case OMP_CLAUSE_LASTPRIVATE:
> ? ? ? ? ?walk_body (convert_nonlocal_reference_stmt,
> ? ? ? ? ? ? ? ? ? ? convert_nonlocal_reference_op, info,
> ! ? ? ? ? ? ? ? ? ? ?OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (clause));
> ? ? ? ? ?break;
>
> ? ? ? ?default:
> --- 1150,1156 ----
> ? ? ? ?case OMP_CLAUSE_LASTPRIVATE:
> ? ? ? ? ?walk_body (convert_nonlocal_reference_stmt,
> ? ? ? ? ? ? ? ? ? ? convert_nonlocal_reference_op, info,
> ! ? ? ? ? ? ? ? ? ? ?&OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (clause));
> ? ? ? ? ?break;
>
> ? ? ? ?default:
> *************** convert_nonlocal_reference_stmt (gimple_
> *** 1261,1267 ****
> ? ? ? ?info->new_local_var_chain = NULL;
>
> ? ? ? ?walk_body (convert_nonlocal_reference_stmt, convert_nonlocal_reference_op,
> ! ? ? ? ? ? ? ? ?info, gimple_omp_body (stmt));
>
> ? ? ? ?if (info->new_local_var_chain)
> ? ? ? ?declare_vars (info->new_local_var_chain,
> --- 1263,1269 ----
> ? ? ? ?info->new_local_var_chain = NULL;
>
> ? ? ? ?walk_body (convert_nonlocal_reference_stmt, convert_nonlocal_reference_op,
> ! ? ? ? ? ? ? ? ?info, gimple_omp_body_ptr (stmt));
>
> ? ? ? ?if (info->new_local_var_chain)
> ? ? ? ?declare_vars (info->new_local_var_chain,
> *************** convert_nonlocal_reference_stmt (gimple_
> *** 1277,1283 ****
> ? ? ? ?walk_gimple_omp_for (stmt, convert_nonlocal_reference_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? ? convert_nonlocal_reference_op, info);
> ? ? ? ?walk_body (convert_nonlocal_reference_stmt,
> ! ? ? ? ? ? ? ? ?convert_nonlocal_reference_op, info, gimple_omp_body (stmt));
> ? ? ? ?info->suppress_expansion = save_suppress;
> ? ? ? ?break;
>
> --- 1279,1285 ----
> ? ? ? ?walk_gimple_omp_for (stmt, convert_nonlocal_reference_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? ? convert_nonlocal_reference_op, info);
> ? ? ? ?walk_body (convert_nonlocal_reference_stmt,
> ! ? ? ? ? ? ? ? ?convert_nonlocal_reference_op, info, gimple_omp_body_ptr (stmt));
> ? ? ? ?info->suppress_expansion = save_suppress;
> ? ? ? ?break;
>
> *************** convert_nonlocal_reference_stmt (gimple_
> *** 1285,1291 ****
> ? ? ? ?save_suppress = info->suppress_expansion;
> ? ? ? ?convert_nonlocal_omp_clauses (gimple_omp_sections_clauses_ptr (stmt), wi);
> ? ? ? ?walk_body (convert_nonlocal_reference_stmt, convert_nonlocal_reference_op,
> ! ? ? ? ? ? ? ? ?info, gimple_omp_body (stmt));
> ? ? ? ?info->suppress_expansion = save_suppress;
> ? ? ? ?break;
>
> --- 1287,1293 ----
> ? ? ? ?save_suppress = info->suppress_expansion;
> ? ? ? ?convert_nonlocal_omp_clauses (gimple_omp_sections_clauses_ptr (stmt), wi);
> ? ? ? ?walk_body (convert_nonlocal_reference_stmt, convert_nonlocal_reference_op,
> ! ? ? ? ? ? ? ? ?info, gimple_omp_body_ptr (stmt));
> ? ? ? ?info->suppress_expansion = save_suppress;
> ? ? ? ?break;
>
> *************** convert_nonlocal_reference_stmt (gimple_
> *** 1293,1299 ****
> ? ? ? ?save_suppress = info->suppress_expansion;
> ? ? ? ?convert_nonlocal_omp_clauses (gimple_omp_single_clauses_ptr (stmt), wi);
> ? ? ? ?walk_body (convert_nonlocal_reference_stmt, convert_nonlocal_reference_op,
> ! ? ? ? ? ? ? ? ?info, gimple_omp_body (stmt));
> ? ? ? ?info->suppress_expansion = save_suppress;
> ? ? ? ?break;
>
> --- 1295,1301 ----
> ? ? ? ?save_suppress = info->suppress_expansion;
> ? ? ? ?convert_nonlocal_omp_clauses (gimple_omp_single_clauses_ptr (stmt), wi);
> ? ? ? ?walk_body (convert_nonlocal_reference_stmt, convert_nonlocal_reference_op,
> ! ? ? ? ? ? ? ? ?info, gimple_omp_body_ptr (stmt));
> ? ? ? ?info->suppress_expansion = save_suppress;
> ? ? ? ?break;
>
> *************** convert_nonlocal_reference_stmt (gimple_
> *** 1301,1307 ****
> ? ? ?case GIMPLE_OMP_MASTER:
> ? ? ?case GIMPLE_OMP_ORDERED:
> ? ? ? ?walk_body (convert_nonlocal_reference_stmt, convert_nonlocal_reference_op,
> ! ? ? ? ? ? ? ? ?info, gimple_omp_body (stmt));
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_BIND:
> --- 1303,1309 ----
> ? ? ?case GIMPLE_OMP_MASTER:
> ? ? ?case GIMPLE_OMP_ORDERED:
> ? ? ? ?walk_body (convert_nonlocal_reference_stmt, convert_nonlocal_reference_op,
> ! ? ? ? ? ? ? ? ?info, gimple_omp_body_ptr (stmt));
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_BIND:
> *************** convert_local_omp_clauses (tree *pclause
> *** 1635,1644 ****
> ? ? ? ? ? ? ? ?= info->context;
> ? ? ? ? ? ? ?walk_body (convert_local_reference_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? convert_local_reference_op, info,
> ! ? ? ? ? ? ? ? ? ? ? ? ?OMP_CLAUSE_REDUCTION_GIMPLE_INIT (clause));
> ? ? ? ? ? ? ?walk_body (convert_local_reference_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? convert_local_reference_op, info,
> ! ? ? ? ? ? ? ? ? ? ? ? ?OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (clause));
> ? ? ? ? ? ? ?DECL_CONTEXT (OMP_CLAUSE_REDUCTION_PLACEHOLDER (clause))
> ? ? ? ? ? ? ? ?= old_context;
> ? ? ? ? ? ?}
> --- 1637,1646 ----
> ? ? ? ? ? ? ? ?= info->context;
> ? ? ? ? ? ? ?walk_body (convert_local_reference_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? convert_local_reference_op, info,
> ! ? ? ? ? ? ? ? ? ? ? ? ?&OMP_CLAUSE_REDUCTION_GIMPLE_INIT (clause));
> ? ? ? ? ? ? ?walk_body (convert_local_reference_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? convert_local_reference_op, info,
> ! ? ? ? ? ? ? ? ? ? ? ? ?&OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (clause));
> ? ? ? ? ? ? ?DECL_CONTEXT (OMP_CLAUSE_REDUCTION_PLACEHOLDER (clause))
> ? ? ? ? ? ? ? ?= old_context;
> ? ? ? ? ? ?}
> *************** convert_local_omp_clauses (tree *pclause
> *** 1647,1653 ****
> ? ? ? ?case OMP_CLAUSE_LASTPRIVATE:
> ? ? ? ? ?walk_body (convert_local_reference_stmt,
> ? ? ? ? ? ? ? ? ? ? convert_local_reference_op, info,
> ! ? ? ? ? ? ? ? ? ? ?OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (clause));
> ? ? ? ? ?break;
>
> ? ? ? ?default:
> --- 1649,1655 ----
> ? ? ? ?case OMP_CLAUSE_LASTPRIVATE:
> ? ? ? ? ?walk_body (convert_local_reference_stmt,
> ? ? ? ? ? ? ? ? ? ? convert_local_reference_op, info,
> ! ? ? ? ? ? ? ? ? ? ?&OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (clause));
> ? ? ? ? ?break;
>
> ? ? ? ?default:
> *************** convert_local_reference_stmt (gimple_stm
> *** 1692,1698 ****
> ? ? ? ?info->new_local_var_chain = NULL;
>
> ? ? ? ?walk_body (convert_local_reference_stmt, convert_local_reference_op, info,
> ! ? ? ? ? ? ? ? ?gimple_omp_body (stmt));
>
> ? ? ? ?if (info->new_local_var_chain)
> ? ? ? ?declare_vars (info->new_local_var_chain,
> --- 1694,1700 ----
> ? ? ? ?info->new_local_var_chain = NULL;
>
> ? ? ? ?walk_body (convert_local_reference_stmt, convert_local_reference_op, info,
> ! ? ? ? ? ? ? ? ?gimple_omp_body_ptr (stmt));
>
> ? ? ? ?if (info->new_local_var_chain)
> ? ? ? ?declare_vars (info->new_local_var_chain,
> *************** convert_local_reference_stmt (gimple_stm
> *** 1707,1713 ****
> ? ? ? ?walk_gimple_omp_for (stmt, convert_local_reference_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? ? convert_local_reference_op, info);
> ? ? ? ?walk_body (convert_local_reference_stmt, convert_local_reference_op,
> ! ? ? ? ? ? ? ? ?info, gimple_omp_body (stmt));
> ? ? ? ?info->suppress_expansion = save_suppress;
> ? ? ? ?break;
>
> --- 1709,1715 ----
> ? ? ? ?walk_gimple_omp_for (stmt, convert_local_reference_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? ? convert_local_reference_op, info);
> ? ? ? ?walk_body (convert_local_reference_stmt, convert_local_reference_op,
> ! ? ? ? ? ? ? ? ?info, gimple_omp_body_ptr (stmt));
> ? ? ? ?info->suppress_expansion = save_suppress;
> ? ? ? ?break;
>
> *************** convert_local_reference_stmt (gimple_stm
> *** 1715,1721 ****
> ? ? ? ?save_suppress = info->suppress_expansion;
> ? ? ? ?convert_local_omp_clauses (gimple_omp_sections_clauses_ptr (stmt), wi);
> ? ? ? ?walk_body (convert_local_reference_stmt, convert_local_reference_op,
> ! ? ? ? ? ? ? ? ?info, gimple_omp_body (stmt));
> ? ? ? ?info->suppress_expansion = save_suppress;
> ? ? ? ?break;
>
> --- 1717,1723 ----
> ? ? ? ?save_suppress = info->suppress_expansion;
> ? ? ? ?convert_local_omp_clauses (gimple_omp_sections_clauses_ptr (stmt), wi);
> ? ? ? ?walk_body (convert_local_reference_stmt, convert_local_reference_op,
> ! ? ? ? ? ? ? ? ?info, gimple_omp_body_ptr (stmt));
> ? ? ? ?info->suppress_expansion = save_suppress;
> ? ? ? ?break;
>
> *************** convert_local_reference_stmt (gimple_stm
> *** 1723,1729 ****
> ? ? ? ?save_suppress = info->suppress_expansion;
> ? ? ? ?convert_local_omp_clauses (gimple_omp_single_clauses_ptr (stmt), wi);
> ? ? ? ?walk_body (convert_local_reference_stmt, convert_local_reference_op,
> ! ? ? ? ? ? ? ? ?info, gimple_omp_body (stmt));
> ? ? ? ?info->suppress_expansion = save_suppress;
> ? ? ? ?break;
>
> --- 1725,1731 ----
> ? ? ? ?save_suppress = info->suppress_expansion;
> ? ? ? ?convert_local_omp_clauses (gimple_omp_single_clauses_ptr (stmt), wi);
> ? ? ? ?walk_body (convert_local_reference_stmt, convert_local_reference_op,
> ! ? ? ? ? ? ? ? ?info, gimple_omp_body_ptr (stmt));
> ? ? ? ?info->suppress_expansion = save_suppress;
> ? ? ? ?break;
>
> *************** convert_local_reference_stmt (gimple_stm
> *** 1731,1737 ****
> ? ? ?case GIMPLE_OMP_MASTER:
> ? ? ?case GIMPLE_OMP_ORDERED:
> ? ? ? ?walk_body (convert_local_reference_stmt, convert_local_reference_op,
> ! ? ? ? ? ? ? ? ?info, gimple_omp_body (stmt));
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_COND:
> --- 1733,1739 ----
> ? ? ?case GIMPLE_OMP_MASTER:
> ? ? ?case GIMPLE_OMP_ORDERED:
> ? ? ? ?walk_body (convert_local_reference_stmt, convert_local_reference_op,
> ! ? ? ? ? ? ? ? ?info, gimple_omp_body_ptr (stmt));
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_COND:
> *************** convert_nl_goto_reference (gimple_stmt_i
> *** 1809,1820 ****
>
> ? ?/* Build: __builtin_nl_goto(new_label, &chain->nl_goto_field). ?*/
> ? ?field = get_nl_goto_field (i);
> ! ? x = get_frame_field (info, target_context, field, &wi->gsi);
> ? ?x = build_addr (x, target_context);
> ! ? x = gsi_gimplify_val (info, x, &wi->gsi);
> ? ?call = gimple_build_call (builtin_decl_implicit (BUILT_IN_NONLOCAL_GOTO),
> ? ? ? ? ? ? ? ? ? ? ? ? ? ?2, build_addr (new_label, target_context), x);
> ! ? gsi_replace (&wi->gsi, call, false);
>
> ? ?/* We have handled all of STMT's operands, no need to keep going. ?*/
> ? ?*handled_ops_p = true;
> --- 1811,1822 ----
>
> ? ?/* Build: __builtin_nl_goto(new_label, &chain->nl_goto_field). ?*/
> ? ?field = get_nl_goto_field (i);
> ! ? x = get_frame_field (info, target_context, field, gsi);
> ? ?x = build_addr (x, target_context);
> ! ? x = gsi_gimplify_val (info, x, gsi);
> ? ?call = gimple_build_call (builtin_decl_implicit (BUILT_IN_NONLOCAL_GOTO),
> ? ? ? ? ? ? ? ? ? ? ? ? ? ?2, build_addr (new_label, target_context), x);
> ! ? gsi_replace (gsi, call, false);
>
> ? ?/* We have handled all of STMT's operands, no need to keep going. ?*/
> ? ?*handled_ops_p = true;
> *************** convert_tramp_reference_stmt (gimple_stm
> *** 1979,1985 ****
> ? ? ? ?save_local_var_chain = info->new_local_var_chain;
> ? ? ? ?info->new_local_var_chain = NULL;
> ? ? ? ? ?walk_body (convert_tramp_reference_stmt, convert_tramp_reference_op,
> ! ? ? ? ? ? ? ? ? ?info, gimple_omp_body (stmt));
> ? ? ? ?if (info->new_local_var_chain)
> ? ? ? ? ?declare_vars (info->new_local_var_chain,
> ? ? ? ? ? ? ? ? ? ? ? ?gimple_seq_first_stmt (gimple_omp_body (stmt)),
> --- 1981,1987 ----
> ? ? ? ?save_local_var_chain = info->new_local_var_chain;
> ? ? ? ?info->new_local_var_chain = NULL;
> ? ? ? ? ?walk_body (convert_tramp_reference_stmt, convert_tramp_reference_op,
> ! ? ? ? ? ? ? ? ? ?info, gimple_omp_body_ptr (stmt));
> ? ? ? ?if (info->new_local_var_chain)
> ? ? ? ? ?declare_vars (info->new_local_var_chain,
> ? ? ? ? ? ? ? ? ? ? ? ?gimple_seq_first_stmt (gimple_omp_body (stmt)),
> *************** convert_gimple_call (gimple_stmt_iterato
> *** 2035,2041 ****
> ? ? ?case GIMPLE_OMP_TASK:
> ? ? ? ?save_static_chain_added = info->static_chain_added;
> ? ? ? ?info->static_chain_added = 0;
> ! ? ? ? walk_body (convert_gimple_call, NULL, info, gimple_omp_body (stmt));
> ? ? ? ?for (i = 0; i < 2; i++)
> ? ? ? ?{
> ? ? ? ? ?tree c, decl;
> --- 2037,2043 ----
> ? ? ?case GIMPLE_OMP_TASK:
> ? ? ? ?save_static_chain_added = info->static_chain_added;
> ? ? ? ?info->static_chain_added = 0;
> ! ? ? ? walk_body (convert_gimple_call, NULL, info, gimple_omp_body_ptr (stmt));
> ? ? ? ?for (i = 0; i < 2; i++)
> ? ? ? ?{
> ? ? ? ? ?tree c, decl;
> *************** convert_gimple_call (gimple_stmt_iterato
> *** 2065,2071 ****
>
> ? ? ?case GIMPLE_OMP_FOR:
> ? ? ? ?walk_body (convert_gimple_call, NULL, info,
> ! ? ? ? ? ? ? ? ?gimple_omp_for_pre_body (stmt));
> ? ? ? ?/* FALLTHRU */
> ? ? ?case GIMPLE_OMP_SECTIONS:
> ? ? ?case GIMPLE_OMP_SECTION:
> --- 2067,2073 ----
>
> ? ? ?case GIMPLE_OMP_FOR:
> ? ? ? ?walk_body (convert_gimple_call, NULL, info,
> ! ? ? ? ? ? ? ? ?gimple_omp_for_pre_body_ptr (stmt));
> ? ? ? ?/* FALLTHRU */
> ? ? ?case GIMPLE_OMP_SECTIONS:
> ? ? ?case GIMPLE_OMP_SECTION:
> *************** convert_gimple_call (gimple_stmt_iterato
> *** 2073,2079 ****
> ? ? ?case GIMPLE_OMP_MASTER:
> ? ? ?case GIMPLE_OMP_ORDERED:
> ? ? ?case GIMPLE_OMP_CRITICAL:
> ! ? ? ? walk_body (convert_gimple_call, NULL, info, gimple_omp_body (stmt));
> ? ? ? ?break;
>
> ? ? ?default:
> --- 2075,2081 ----
> ? ? ?case GIMPLE_OMP_MASTER:
> ? ? ?case GIMPLE_OMP_ORDERED:
> ? ? ?case GIMPLE_OMP_CRITICAL:
> ! ? ? ? walk_body (convert_gimple_call, NULL, info, gimple_omp_body_ptr (stmt));
> ? ? ? ?break;
>
> ? ? ?default:
> Index: gimple.c
> ===================================================================
> *** gimple.c.orig ? ? ? 2012-05-01 22:43:31.000000000 +0200
> --- gimple.c ? ?2012-05-02 01:55:47.000000000 +0200
> *************** gimple_seq_copy (gimple_seq src)
> *** 1337,1343 ****
> ?}
>
>
> ! /* Walk all the statements in the sequence SEQ calling walk_gimple_stmt
> ? ? on each one. ?WI is as in walk_gimple_stmt.
>
> ? ? If walk_gimple_stmt returns non-NULL, the walk is stopped, and the
> --- 1337,1343 ----
> ?}
>
>
> ! /* Walk all the statements in the sequence *PSEQ calling walk_gimple_stmt
> ? ? on each one. ?WI is as in walk_gimple_stmt.
>
> ? ? If walk_gimple_stmt returns non-NULL, the walk is stopped, and the
> *************** gimple_seq_copy (gimple_seq src)
> *** 1349,1360 ****
> ? ? Otherwise, all the statements are walked and NULL returned. ?*/
>
> ?gimple
> ! walk_gimple_seq (gimple_seq seq, walk_stmt_fn callback_stmt,
> ! ? ? ? ? ? ? ? ?walk_tree_fn callback_op, struct walk_stmt_info *wi)
> ?{
> ? ?gimple_stmt_iterator gsi;
>
> ! ? for (gsi = gsi_start (seq); !gsi_end_p (gsi); )
> ? ? ?{
> ? ? ? ?tree ret = walk_gimple_stmt (&gsi, callback_stmt, callback_op, wi);
> ? ? ? ?if (ret)
> --- 1349,1360 ----
> ? ? Otherwise, all the statements are walked and NULL returned. ?*/
>
> ?gimple
> ! walk_gimple_seq_mod (gimple_seq *pseq, walk_stmt_fn callback_stmt,
> ! ? ? ? ? ? ? ? ? ? ?walk_tree_fn callback_op, struct walk_stmt_info *wi)
> ?{
> ? ?gimple_stmt_iterator gsi;
>
> ! ? for (gsi = gsi_start (*pseq); !gsi_end_p (gsi); )
> ? ? ?{
> ? ? ? ?tree ret = walk_gimple_stmt (&gsi, callback_stmt, callback_op, wi);
> ? ? ? ?if (ret)
> *************** walk_gimple_seq (gimple_seq seq, walk_st
> *** 1378,1383 ****
> --- 1378,1397 ----
> ?}
>
>
> + /* Like walk_gimple_seq_mod, but ensure that the head of SEQ isn't
> + ? ?changed by the callbacks. ?*/
> +
> + gimple
> + walk_gimple_seq (gimple_seq seq, walk_stmt_fn callback_stmt,
> + ? ? ? ? ? ? ? ?walk_tree_fn callback_op, struct walk_stmt_info *wi)
> + {
> + ? gimple_seq seq2 = seq;
> + ? gimple ret = walk_gimple_seq_mod (&seq2, callback_stmt, callback_op, wi);
> + ? gcc_assert (seq2 == seq);
> + ? return ret;
> + }
> +
> +
> ?/* Helper function for walk_gimple_stmt. ?Walk operands of a GIMPLE_ASM. ?*/
>
> ?static tree
> *************** walk_gimple_stmt (gimple_stmt_iterator *
> *** 1808,1858 ****
> ? ?switch (gimple_code (stmt))
> ? ? ?{
> ? ? ?case GIMPLE_BIND:
> ! ? ? ? ret = walk_gimple_seq (gimple_bind_body (stmt), callback_stmt,
> ! ? ? ? ? ? ? ? ? ? ? ? ? ? ?callback_op, wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_CATCH:
> ! ? ? ? ret = walk_gimple_seq (gimple_catch_handler (stmt), callback_stmt,
> ! ? ? ? ? ? ? ? ? ? ? ? ? ? ?callback_op, wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_EH_FILTER:
> ! ? ? ? ret = walk_gimple_seq (gimple_eh_filter_failure (stmt), callback_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? callback_op, wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_EH_ELSE:
> ! ? ? ? ret = walk_gimple_seq (gimple_eh_else_n_body (stmt),
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? callback_stmt, callback_op, wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
> ! ? ? ? ret = walk_gimple_seq (gimple_eh_else_e_body (stmt),
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? callback_stmt, callback_op, wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_TRY:
> ! ? ? ? ret = walk_gimple_seq (gimple_try_eval (stmt), callback_stmt, callback_op,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
>
> ! ? ? ? ret = walk_gimple_seq (gimple_try_cleanup (stmt), callback_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? callback_op, wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_OMP_FOR:
> ! ? ? ? ret = walk_gimple_seq (gimple_omp_for_pre_body (stmt), callback_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? callback_op, wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
> --- 1822,1872 ----
> ? ?switch (gimple_code (stmt))
> ? ? ?{
> ? ? ?case GIMPLE_BIND:
> ! ? ? ? ret = walk_gimple_seq_mod (gimple_bind_body_ptr (stmt), callback_stmt,
> ! ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?callback_op, wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_CATCH:
> ! ? ? ? ret = walk_gimple_seq_mod (gimple_catch_handler_ptr (stmt), callback_stmt,
> ! ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?callback_op, wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_EH_FILTER:
> ! ? ? ? ret = walk_gimple_seq_mod (gimple_eh_filter_failure_ptr (stmt), callback_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? callback_op, wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_EH_ELSE:
> ! ? ? ? ret = walk_gimple_seq_mod (gimple_eh_else_n_body_ptr (stmt),
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? callback_stmt, callback_op, wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
> ! ? ? ? ret = walk_gimple_seq_mod (gimple_eh_else_e_body_ptr (stmt),
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? callback_stmt, callback_op, wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_TRY:
> ! ? ? ? ret = walk_gimple_seq_mod (gimple_try_eval_ptr (stmt), callback_stmt, callback_op,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
>
> ! ? ? ? ret = walk_gimple_seq_mod (gimple_try_cleanup_ptr (stmt), callback_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? callback_op, wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_OMP_FOR:
> ! ? ? ? ret = walk_gimple_seq_mod (gimple_omp_for_pre_body_ptr (stmt), callback_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? callback_op, wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
> *************** walk_gimple_stmt (gimple_stmt_iterator *
> *** 1866,1886 ****
> ? ? ?case GIMPLE_OMP_TASK:
> ? ? ?case GIMPLE_OMP_SECTIONS:
> ? ? ?case GIMPLE_OMP_SINGLE:
> ! ? ? ? ret = walk_gimple_seq (gimple_omp_body (stmt), callback_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? callback_op, wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_WITH_CLEANUP_EXPR:
> ! ? ? ? ret = walk_gimple_seq (gimple_wce_cleanup (stmt), callback_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? callback_op, wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_TRANSACTION:
> ! ? ? ? ret = walk_gimple_seq (gimple_transaction_body (stmt),
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? callback_stmt, callback_op, wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
> --- 1880,1900 ----
> ? ? ?case GIMPLE_OMP_TASK:
> ? ? ?case GIMPLE_OMP_SECTIONS:
> ? ? ?case GIMPLE_OMP_SINGLE:
> ! ? ? ? ret = walk_gimple_seq_mod (gimple_omp_body_ptr (stmt), callback_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? callback_op, wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_WITH_CLEANUP_EXPR:
> ! ? ? ? ret = walk_gimple_seq_mod (gimple_wce_cleanup_ptr (stmt), callback_stmt,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? callback_op, wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_TRANSACTION:
> ! ? ? ? ret = walk_gimple_seq_mod (gimple_transaction_body_ptr (stmt),
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? callback_stmt, callback_op, wi);
> ? ? ? ?if (ret)
> ? ? ? ?return wi->callback_result;
> Index: gimple.h
> ===================================================================
> *** gimple.h.orig ? ? ? 2012-05-01 22:43:31.000000000 +0200
> --- gimple.h ? ?2012-05-02 01:53:32.000000000 +0200
> *************** gimple_bind_append_vars (gimple gs, tree
> *** 2818,2830 ****
> ?}
>
>
> ?/* Return the GIMPLE sequence contained in the GIMPLE_BIND statement GS. ?*/
>
> ?static inline gimple_seq
> ?gimple_bind_body (gimple gs)
> ?{
> ! ? GIMPLE_CHECK (gs, GIMPLE_BIND);
> ! ? return gs->gimple_bind.body;
> ?}
>
>
> --- 2818,2836 ----
> ?}
>
>
> + static inline gimple_seq *
> + gimple_bind_body_ptr (gimple gs)
> + {
> + ? GIMPLE_CHECK (gs, GIMPLE_BIND);
> + ? return &gs->gimple_bind.body;
> + }
> +
> ?/* Return the GIMPLE sequence contained in the GIMPLE_BIND statement GS. ?*/
>
> ?static inline gimple_seq
> ?gimple_bind_body (gimple gs)
> ?{
> ! ? return *gimple_bind_body_ptr (gs);
> ?}
>
>
> *************** gimple_catch_types_ptr (gimple gs)
> *** 3107,3123 ****
> ?}
>
>
> - /* Return the GIMPLE sequence representing the body of the handler of
> - ? ?GIMPLE_CATCH statement GS. ?*/
> -
> - static inline gimple_seq
> - gimple_catch_handler (gimple gs)
> - {
> - ? GIMPLE_CHECK (gs, GIMPLE_CATCH);
> - ? return gs->gimple_catch.handler;
> - }
> -
> -
> ?/* Return a pointer to the GIMPLE sequence representing the body of
> ? ? the handler of GIMPLE_CATCH statement GS. ?*/
>
> --- 3113,3118 ----
> *************** gimple_catch_handler_ptr (gimple gs)
> *** 3129,3134 ****
> --- 3124,3139 ----
> ?}
>
>
> + /* Return the GIMPLE sequence representing the body of the handler of
> + ? ?GIMPLE_CATCH statement GS. ?*/
> +
> + static inline gimple_seq
> + gimple_catch_handler (gimple gs)
> + {
> + ? return *gimple_catch_handler_ptr (gs);
> + }
> +
> +
> ?/* Set T to be the set of types handled by GIMPLE_CATCH GS. ?*/
>
> ?static inline void
> *************** gimple_eh_filter_types_ptr (gimple gs)
> *** 3170,3183 ****
> ?}
>
>
> ?/* Return the sequence of statement to execute when GIMPLE_EH_FILTER
> ? ? statement fails. ?*/
>
> ?static inline gimple_seq
> ?gimple_eh_filter_failure (gimple gs)
> ?{
> ! ? GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
> ! ? return gs->gimple_eh_filter.failure;
> ?}
>
>
> --- 3175,3198 ----
> ?}
>
>
> + /* Return a pointer to the sequence of statement to execute when
> + ? ?GIMPLE_EH_FILTER statement fails. ?*/
> +
> + static inline gimple_seq *
> + gimple_eh_filter_failure_ptr (gimple gs)
> + {
> + ? GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
> + ? return &gs->gimple_eh_filter.failure;
> + }
> +
> +
> ?/* Return the sequence of statement to execute when GIMPLE_EH_FILTER
> ? ? statement fails. ?*/
>
> ?static inline gimple_seq
> ?gimple_eh_filter_failure (gimple gs)
> ?{
> ! ? return *gimple_eh_filter_failure_ptr (gs);
> ?}
>
>
> *************** gimple_eh_must_not_throw_set_fndecl (gim
> *** 3221,3238 ****
>
> ?/* GIMPLE_EH_ELSE accessors. ?*/
>
> ?static inline gimple_seq
> ?gimple_eh_else_n_body (gimple gs)
> ?{
> ? ?GIMPLE_CHECK (gs, GIMPLE_EH_ELSE);
> ! ? return gs->gimple_eh_else.n_body;
> ?}
>
> ?static inline gimple_seq
> ?gimple_eh_else_e_body (gimple gs)
> ?{
> ! ? GIMPLE_CHECK (gs, GIMPLE_EH_ELSE);
> ! ? return gs->gimple_eh_else.e_body;
> ?}
>
> ?static inline void
> --- 3236,3265 ----
>
> ?/* GIMPLE_EH_ELSE accessors. ?*/
>
> + static inline gimple_seq *
> + gimple_eh_else_n_body_ptr (gimple gs)
> + {
> + ? GIMPLE_CHECK (gs, GIMPLE_EH_ELSE);
> + ? return &gs->gimple_eh_else.n_body;
> + }
> +
> ?static inline gimple_seq
> ?gimple_eh_else_n_body (gimple gs)
> ?{
> + ? return *gimple_eh_else_n_body_ptr (gs);
> + }
> +
> + static inline gimple_seq *
> + gimple_eh_else_e_body_ptr (gimple gs)
> + {
> ? ?GIMPLE_CHECK (gs, GIMPLE_EH_ELSE);
> ! ? return &gs->gimple_eh_else.e_body;
> ?}
>
> ?static inline gimple_seq
> ?gimple_eh_else_e_body (gimple gs)
> ?{
> ! ? return *gimple_eh_else_e_body_ptr (gs);
> ?}
>
> ?static inline void
> *************** gimple_try_catch_is_cleanup (const_gimpl
> *** 3285,3297 ****
> ?}
>
>
> ?/* Return the sequence of statements used as the body for GIMPLE_TRY GS. ?*/
>
> ?static inline gimple_seq
> ?gimple_try_eval (gimple gs)
> ?{
> ? ?GIMPLE_CHECK (gs, GIMPLE_TRY);
> ! ? return gs->gimple_try.eval;
> ?}
>
>
> --- 3312,3345 ----
> ?}
>
>
> + /* Return a pointer to the sequence of statements used as the
> + ? ?body for GIMPLE_TRY GS. ?*/
> +
> + static inline gimple_seq *
> + gimple_try_eval_ptr (gimple gs)
> + {
> + ? GIMPLE_CHECK (gs, GIMPLE_TRY);
> + ? return &gs->gimple_try.eval;
> + }
> +
> +
> ?/* Return the sequence of statements used as the body for GIMPLE_TRY GS. ?*/
>
> ?static inline gimple_seq
> ?gimple_try_eval (gimple gs)
> ?{
> + ? return *gimple_try_eval_ptr (gs);
> + }
> +
> +
> + /* Return a pointer to the sequence of statements used as the cleanup body for
> + ? ?GIMPLE_TRY GS. ?*/
> +
> + static inline gimple_seq *
> + gimple_try_cleanup_ptr (gimple gs)
> + {
> ? ?GIMPLE_CHECK (gs, GIMPLE_TRY);
> ! ? return &gs->gimple_try.cleanup;
> ?}
>
>
> *************** gimple_try_eval (gimple gs)
> *** 3301,3308 ****
> ?static inline gimple_seq
> ?gimple_try_cleanup (gimple gs)
> ?{
> ! ? GIMPLE_CHECK (gs, GIMPLE_TRY);
> ! ? return gs->gimple_try.cleanup;
> ?}
>
>
> --- 3349,3355 ----
> ?static inline gimple_seq
> ?gimple_try_cleanup (gimple gs)
> ?{
> ! ? return *gimple_try_cleanup_ptr (gs);
> ?}
>
>
> *************** gimple_try_set_cleanup (gimple gs, gimpl
> *** 3341,3353 ****
> ?}
>
>
> ?/* Return the cleanup sequence for cleanup statement GS. ?*/
>
> ?static inline gimple_seq
> ?gimple_wce_cleanup (gimple gs)
> ?{
> ! ? GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
> ! ? return gs->gimple_wce.cleanup;
> ?}
>
>
> --- 3388,3409 ----
> ?}
>
>
> + /* Return a pointer to the cleanup sequence for cleanup statement GS. ?*/
> +
> + static inline gimple_seq *
> + gimple_wce_cleanup_ptr (gimple gs)
> + {
> + ? GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
> + ? return &gs->gimple_wce.cleanup;
> + }
> +
> +
> ?/* Return the cleanup sequence for cleanup statement GS. ?*/
>
> ?static inline gimple_seq
> ?gimple_wce_cleanup (gimple gs)
> ?{
> ! ? return *gimple_wce_cleanup_ptr (gs);
> ?}
>
>
> *************** gimple_debug_source_bind_set_value (gimp
> *** 3746,3757 ****
> ? ?gimple_set_op (dbg, 1, value);
> ?}
>
> ?/* Return the body for the OMP statement GS. ?*/
>
> ?static inline gimple_seq
> ?gimple_omp_body (gimple gs)
> ?{
> ! ? return gs->omp.body;
> ?}
>
> ?/* Set BODY to be the body for the OMP statement GS. ?*/
> --- 3802,3821 ----
> ? ?gimple_set_op (dbg, 1, value);
> ?}
>
> + /* Return a pointer to the body for the OMP statement GS. ?*/
> +
> + static inline gimple_seq *
> + gimple_omp_body_ptr (gimple gs)
> + {
> + ? return &gs->omp.body;
> + }
> +
> ?/* Return the body for the OMP statement GS. ?*/
>
> ?static inline gimple_seq
> ?gimple_omp_body (gimple gs)
> ?{
> ! ? return *gimple_omp_body_ptr (gs);
> ?}
>
> ?/* Set BODY to be the body for the OMP statement GS. ?*/
> *************** gimple_omp_for_set_incr (gimple gs, size
> *** 3965,3978 ****
> ?}
>
>
> ?/* Return the sequence of statements to execute before the OMP_FOR
> ? ? statement GS starts. ?*/
>
> ?static inline gimple_seq
> ?gimple_omp_for_pre_body (gimple gs)
> ?{
> ! ? GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
> ! ? return gs->gimple_omp_for.pre_body;
> ?}
>
>
> --- 4029,4052 ----
> ?}
>
>
> + /* Return a pointer to the sequence of statements to execute before the OMP_FOR
> + ? ?statement GS starts. ?*/
> +
> + static inline gimple_seq *
> + gimple_omp_for_pre_body_ptr (gimple gs)
> + {
> + ? GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
> + ? return &gs->gimple_omp_for.pre_body;
> + }
> +
> +
> ?/* Return the sequence of statements to execute before the OMP_FOR
> ? ? statement GS starts. ?*/
>
> ?static inline gimple_seq
> ?gimple_omp_for_pre_body (gimple gs)
> ?{
> ! ? return *gimple_omp_for_pre_body_ptr (gs);
> ?}
>
>
> *************** gimple_omp_continue_set_control_use (gim
> *** 4626,4638 ****
> ? ?g->gimple_omp_continue.control_use = use;
> ?}
>
> ?/* Return the body for the GIMPLE_TRANSACTION statement GS. ?*/
>
> ?static inline gimple_seq
> ?gimple_transaction_body (gimple gs)
> ?{
> ! ? GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
> ! ? return gs->gimple_transaction.body;
> ?}
>
> ?/* Return the label associated with a GIMPLE_TRANSACTION. ?*/
> --- 4700,4720 ----
> ? ?g->gimple_omp_continue.control_use = use;
> ?}
>
> + /* Return a pointer to the body for the GIMPLE_TRANSACTION statement GS. ?*/
> +
> + static inline gimple_seq *
> + gimple_transaction_body_ptr (gimple gs)
> + {
> + ? GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
> + ? return &gs->gimple_transaction.body;
> + }
> +
> ?/* Return the body for the GIMPLE_TRANSACTION statement GS. ?*/
>
> ?static inline gimple_seq
> ?gimple_transaction_body (gimple gs)
> ?{
> ! ? return *gimple_transaction_body_ptr (gs);
> ?}
>
> ?/* Return the label associated with a GIMPLE_TRANSACTION. ?*/
> *************** enum gsi_iterator_update
> *** 5070,5077 ****
> ?/* In gimple-iterator.c ?*/
> ?gimple_stmt_iterator gsi_start_phis (basic_block);
> ?gimple_seq gsi_split_seq_after (gimple_stmt_iterator);
> ! gimple_seq gsi_split_seq_before (gimple_stmt_iterator *);
> ?void gsi_replace (gimple_stmt_iterator *, gimple, bool);
> ?void gsi_insert_before (gimple_stmt_iterator *, gimple,
> ? ? ? ? ? ? ? ? ? ? ? ?enum gsi_iterator_update);
> ?void gsi_insert_before_without_update (gimple_stmt_iterator *, gimple,
> --- 5152,5161 ----
> ?/* In gimple-iterator.c ?*/
> ?gimple_stmt_iterator gsi_start_phis (basic_block);
> ?gimple_seq gsi_split_seq_after (gimple_stmt_iterator);
> ! void gsi_split_seq_before (gimple_stmt_iterator *, gimple_seq *);
> ! void gsi_set_stmt (gimple_stmt_iterator *, gimple);
> ?void gsi_replace (gimple_stmt_iterator *, gimple, bool);
> + void gsi_replace_with_seq (gimple_stmt_iterator *, gimple_seq, bool);
> ?void gsi_insert_before (gimple_stmt_iterator *, gimple,
> ? ? ? ? ? ? ? ? ? ? ? ?enum gsi_iterator_update);
> ?void gsi_insert_before_without_update (gimple_stmt_iterator *, gimple,
> *************** typedef tree (*walk_stmt_fn) (gimple_stm
> *** 5166,5171 ****
> --- 5250,5257 ----
>
> ?gimple walk_gimple_seq (gimple_seq, walk_stmt_fn, walk_tree_fn,
> ? ? ? ? ? ? ? ? ? ? ? ?struct walk_stmt_info *);
> + gimple walk_gimple_seq_mod (gimple_seq *, walk_stmt_fn, walk_tree_fn,
> + ? ? ? ? ? ? ? ? ? ? ? ? ? struct walk_stmt_info *);
> ?tree walk_gimple_stmt (gimple_stmt_iterator *, walk_stmt_fn, walk_tree_fn,
> ? ? ? ? ? ? ? ? ? ? ? struct walk_stmt_info *);
> ?tree walk_gimple_op (gimple, walk_tree_fn, struct walk_stmt_info *);
> Index: trans-mem.c
> ===================================================================
> *** trans-mem.c.orig ? ?2012-05-01 22:43:31.000000000 +0200
> --- trans-mem.c 2012-05-02 01:53:33.000000000 +0200
> *************** lower_transaction (gimple_stmt_iterator
> *** 1570,1577 ****
> ? ? ? us some idea of what we're dealing with. ?*/
> ? ?memset (&this_wi, 0, sizeof (this_wi));
> ? ?this_wi.info = (void *) &this_state;
> ! ? walk_gimple_seq (gimple_transaction_body (stmt),
> ! ? ? ? ? ? ? ? ? ?lower_sequence_tm, NULL, &this_wi);
>
> ? ?/* If there was absolutely nothing transaction related inside the
> ? ? ? transaction, we may elide it. ?Likewise if this is a nested
> --- 1570,1577 ----
> ? ? ? us some idea of what we're dealing with. ?*/
> ? ?memset (&this_wi, 0, sizeof (this_wi));
> ? ?this_wi.info = (void *) &this_state;
> ! ? walk_gimple_seq_mod (gimple_transaction_body_ptr (stmt),
> ! ? ? ? ? ? ? ? ? ? ? ?lower_sequence_tm, NULL, &this_wi);
>
> ? ?/* If there was absolutely nothing transaction related inside the
> ? ? ? transaction, we may elide it. ?Likewise if this is a nested
> *************** static unsigned int
> *** 1704,1716 ****
> ?execute_lower_tm (void)
> ?{
> ? ?struct walk_stmt_info wi;
>
> ? ?/* Transactional clones aren't created until a later pass. ?*/
> ? ?gcc_assert (!decl_is_tm_clone (current_function_decl));
>
> ? ?memset (&wi, 0, sizeof (wi));
> ! ? walk_gimple_seq (gimple_body (current_function_decl),
> ! ? ? ? ? ? ? ? ? ?lower_sequence_no_tm, NULL, &wi);
>
> ? ?return 0;
> ?}
> --- 1704,1718 ----
> ?execute_lower_tm (void)
> ?{
> ? ?struct walk_stmt_info wi;
> + ? gimple_seq body;
>
> ? ?/* Transactional clones aren't created until a later pass. ?*/
> ? ?gcc_assert (!decl_is_tm_clone (current_function_decl));
>
> + ? body = gimple_body (current_function_decl);
> ? ?memset (&wi, 0, sizeof (wi));
> ! ? walk_gimple_seq_mod (&body, lower_sequence_no_tm, NULL, &wi);
> ! ? gimple_set_body (current_function_decl, body);
>
> ? ?return 0;
> ?}
> Index: tree-eh.c
> ===================================================================
> *** tree-eh.c.orig ? ? ?2012-05-01 22:43:31.000000000 +0200
> --- tree-eh.c ? 2012-05-02 01:53:33.000000000 +0200
> *************** static gimple_seq lower_eh_must_not_thro
> *** 406,412 ****
>
> ?#define LARGE_GOTO_QUEUE 20
>
> ! static void lower_eh_constructs_1 (struct leh_state *state, gimple_seq seq);
>
> ?static gimple_seq
> ?find_goto_replacement (struct leh_tf_state *tf, treemple stmt)
> --- 406,412 ----
>
> ?#define LARGE_GOTO_QUEUE 20
>
> ! static void lower_eh_constructs_1 (struct leh_state *state, gimple_seq *seq);
>
> ?static gimple_seq
> ?find_goto_replacement (struct leh_tf_state *tf, treemple stmt)
> *************** replace_goto_queue_cond_clause (tree *tp
> *** 481,487 ****
> ?/* The real work of replace_goto_queue. ?Returns with TSI updated to
> ? ? point to the next statement. ?*/
>
> ! static void replace_goto_queue_stmt_list (gimple_seq, struct leh_tf_state *);
>
> ?static void
> ?replace_goto_queue_1 (gimple stmt, struct leh_tf_state *tf,
> --- 481,487 ----
> ?/* The real work of replace_goto_queue. ?Returns with TSI updated to
> ? ? point to the next statement. ?*/
>
> ! static void replace_goto_queue_stmt_list (gimple_seq *, struct leh_tf_state *);
>
> ?static void
> ?replace_goto_queue_1 (gimple stmt, struct leh_tf_state *tf,
> *************** replace_goto_queue_1 (gimple stmt, struc
> *** 511,528 ****
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_TRY:
> ! ? ? ? replace_goto_queue_stmt_list (gimple_try_eval (stmt), tf);
> ! ? ? ? replace_goto_queue_stmt_list (gimple_try_cleanup (stmt), tf);
> ? ? ? ?break;
> ? ? ?case GIMPLE_CATCH:
> ! ? ? ? replace_goto_queue_stmt_list (gimple_catch_handler (stmt), tf);
> ? ? ? ?break;
> ? ? ?case GIMPLE_EH_FILTER:
> ! ? ? ? replace_goto_queue_stmt_list (gimple_eh_filter_failure (stmt), tf);
> ? ? ? ?break;
> ? ? ?case GIMPLE_EH_ELSE:
> ! ? ? ? replace_goto_queue_stmt_list (gimple_eh_else_n_body (stmt), tf);
> ! ? ? ? replace_goto_queue_stmt_list (gimple_eh_else_e_body (stmt), tf);
> ? ? ? ?break;
>
> ? ? ?default:
> --- 511,528 ----
> ? ? ? ?break;
>
> ? ? ?case GIMPLE_TRY:
> ! ? ? ? replace_goto_queue_stmt_list (gimple_try_eval_ptr (stmt), tf);
> ! ? ? ? replace_goto_queue_stmt_list (gimple_try_cleanup_ptr (stmt), tf);
> ? ? ? ?break;
> ? ? ?case GIMPLE_CATCH:
> ! ? ? ? replace_goto_queue_stmt_list (gimple_catch_handler_ptr (stmt), tf);
> ? ? ? ?break;
> ? ? ?case GIMPLE_EH_FILTER:
> ! ? ? ? replace_goto_queue_stmt_list (gimple_eh_filter_failure_ptr (stmt), tf);
> ? ? ? ?break;
> ? ? ?case GIMPLE_EH_ELSE:
> ! ? ? ? replace_goto_queue_stmt_list (gimple_eh_else_n_body_ptr (stmt), tf);
> ! ? ? ? replace_goto_queue_stmt_list (gimple_eh_else_e_body_ptr (stmt), tf);
> ? ? ? ?break;
>
> ? ? ?default:
> *************** replace_goto_queue_1 (gimple stmt, struc
> *** 536,544 ****
> ?/* A subroutine of replace_goto_queue. ?Handles GIMPLE_SEQ. ?*/
>
> ?static void
> ! replace_goto_queue_stmt_list (gimple_seq seq, struct leh_tf_state *tf)
> ?{
> ! ? gimple_stmt_iterator gsi = gsi_start (seq);
>
> ? ?while (!gsi_end_p (gsi))
> ? ? ?replace_goto_queue_1 (gsi_stmt (gsi), tf, &gsi);
> --- 536,544 ----
> ?/* A subroutine of replace_goto_queue. ?Handles GIMPLE_SEQ. ?*/
>
> ?static void
> ! replace_goto_queue_stmt_list (gimple_seq *seq, struct leh_tf_state *tf)
> ?{
> ! ? gimple_stmt_iterator gsi = gsi_start (*seq);
>
> ? ?while (!gsi_end_p (gsi))
> ? ? ?replace_goto_queue_1 (gsi_stmt (gsi), tf, &gsi);
> *************** replace_goto_queue (struct leh_tf_state
> *** 551,558 ****
> ?{
> ? ?if (tf->goto_queue_active == 0)
> ? ? ?return;
> ! ? replace_goto_queue_stmt_list (tf->top_p_seq, tf);
> ! ? replace_goto_queue_stmt_list (eh_seq, tf);
> ?}
>
> ?/* Add a new record to the goto queue contained in TF. NEW_STMT is the
> --- 551,558 ----
> ?{
> ? ?if (tf->goto_queue_active == 0)
> ? ? ?return;
> ! ? replace_goto_queue_stmt_list (&tf->top_p_seq, tf);
> ! ? replace_goto_queue_stmt_list (&eh_seq, tf);
> ?}
>
> ?/* Add a new record to the goto queue contained in TF. NEW_STMT is the
> *************** lower_try_finally_nofallthru (struct leh
> *** 1050,1062 ****
> ? ?if (eh_else)
> ? ? ?{
> ? ? ? ?finally = gimple_eh_else_n_body (eh_else);
> ! ? ? ? lower_eh_constructs_1 (state, finally);
> ? ? ? ?gimple_seq_add_seq (&tf->top_p_seq, finally);
>
> ? ? ? ?if (tf->may_throw)
> ? ? ? ?{
> ? ? ? ? ?finally = gimple_eh_else_e_body (eh_else);
> ! ? ? ? ? lower_eh_constructs_1 (state, finally);
>
> ? ? ? ? ?emit_post_landing_pad (&eh_seq, tf->region);
> ? ? ? ? ?gimple_seq_add_seq (&eh_seq, finally);
> --- 1050,1062 ----
> ? ?if (eh_else)
> ? ? ?{
> ? ? ? ?finally = gimple_eh_else_n_body (eh_else);
> ! ? ? ? lower_eh_constructs_1 (state, &finally);
> ? ? ? ?gimple_seq_add_seq (&tf->top_p_seq, finally);
>
> ? ? ? ?if (tf->may_throw)
> ? ? ? ?{
> ? ? ? ? ?finally = gimple_eh_else_e_body (eh_else);
> ! ? ? ? ? lower_eh_constructs_1 (state, &finally);
>
> ? ? ? ? ?emit_post_landing_pad (&eh_seq, tf->region);
> ? ? ? ? ?gimple_seq_add_seq (&eh_seq, finally);
> *************** lower_try_finally_nofallthru (struct leh
> *** 1064,1070 ****
> ? ? ?}
> ? ?else
> ? ? ?{
> ! ? ? ? lower_eh_constructs_1 (state, finally);
> ? ? ? ?gimple_seq_add_seq (&tf->top_p_seq, finally);
>
> ? ? ? ?if (tf->may_throw)
> --- 1064,1070 ----
> ? ? ?}
> ? ?else
> ? ? ?{
> ! ? ? ? lower_eh_constructs_1 (state, &finally);
> ? ? ? ?gimple_seq_add_seq (&tf->top_p_seq, finally);
>
> ? ? ? ?if (tf->may_throw)
> *************** lower_try_finally_onedest (struct leh_st
> *** 1105,1111 ****
> ? ? ? ?finally = gimple_eh_else_n_body (x);
> ? ? ?}
>
> ! ? lower_eh_constructs_1 (state, finally);
>
> ? ?if (tf->may_throw)
> ? ? ?{
> --- 1105,1111 ----
> ? ? ? ?finally = gimple_eh_else_n_body (x);
> ? ? ?}
>
> ! ? lower_eh_constructs_1 (state, &finally);
>
> ? ?if (tf->may_throw)
> ? ? ?{
> *************** lower_try_finally_copy (struct leh_state
> *** 1193,1199 ****
> ? ?if (tf->may_fallthru)
> ? ? ?{
> ? ? ? ?seq = lower_try_finally_dup_block (finally, state);
> ! ? ? ? lower_eh_constructs_1 (state, seq);
> ? ? ? ?gimple_seq_add_seq (&new_stmt, seq);
>
> ? ? ? ?tmp = lower_try_finally_fallthru_label (tf);
> --- 1193,1199 ----
> ? ?if (tf->may_fallthru)
> ? ? ?{
> ? ? ? ?seq = lower_try_finally_dup_block (finally, state);
> ! ? ? ? lower_eh_constructs_1 (state, &seq);
> ? ? ? ?gimple_seq_add_seq (&new_stmt, seq);
>
> ? ? ? ?tmp = lower_try_finally_fallthru_label (tf);
> *************** lower_try_finally_copy (struct leh_state
> *** 1209,1215 ****
> ? ? ? ?seq = gimple_eh_else_e_body (eh_else);
> ? ? ? ?else
> ? ? ? ?seq = lower_try_finally_dup_block (finally, state);
> ! ? ? ? lower_eh_constructs_1 (state, seq);
>
> ? ? ? ?emit_post_landing_pad (&eh_seq, tf->region);
> ? ? ? ?gimple_seq_add_seq (&eh_seq, seq);
> --- 1209,1215 ----
> ? ? ? ?seq = gimple_eh_else_e_body (eh_else);
> ? ? ? ?else
> ? ? ? ?seq = lower_try_finally_dup_block (finally, state);
> ! ? ? ? lower_eh_constructs_1 (state, &seq);
>
> ? ? ? ?emit_post_landing_pad (&eh_seq, tf->region);
> ? ? ? ?gimple_seq_add_seq (&eh_seq, seq);
> *************** lower_try_finally_copy (struct leh_state
> *** 1259,1265 ****
> ? ? ? ? ? ?gimple_seq_add_stmt (&new_stmt, x);
>
> ? ? ? ? ?seq = lower_try_finally_dup_block (finally, state);
> ! ? ? ? ? lower_eh_constructs_1 (state, seq);
> ? ? ? ? ? ?gimple_seq_add_seq (&new_stmt, seq);
>
> ? ? ? ? ? ?gimple_seq_add_stmt (&new_stmt, q->cont_stmt);
> --- 1259,1265 ----
> ? ? ? ? ? ?gimple_seq_add_stmt (&new_stmt, x);
>
> ? ? ? ? ?seq = lower_try_finally_dup_block (finally, state);
> ! ? ? ? ? lower_eh_constructs_1 (state, &seq);
> ? ? ? ? ? ?gimple_seq_add_seq (&new_stmt, seq);
>
> ? ? ? ? ? ?gimple_seq_add_stmt (&new_stmt, q->cont_stmt);
> *************** lower_try_finally_switch (struct leh_sta
> *** 1331,1337 ****
> ? ? ?: tf_loc;
>
> ? ?/* Lower the finally block itself. ?*/
> ! ? lower_eh_constructs_1 (state, finally);
>
> ? ?/* Prepare for switch statement generation. ?*/
> ? ?nlabels = VEC_length (tree, tf->dest_array);
> --- 1331,1337 ----
> ? ? ?: tf_loc;
>
> ? ?/* Lower the finally block itself. ?*/
> ! ? lower_eh_constructs_1 (state, &finally);
>
> ? ?/* Prepare for switch statement generation. ?*/
> ? ?nlabels = VEC_length (tree, tf->dest_array);
> *************** lower_try_finally_switch (struct leh_sta
> *** 1382,1388 ****
> ? ? ? ?if (tf->may_throw)
> ? ? ? ?{
> ? ? ? ? ?finally = gimple_eh_else_e_body (eh_else);
> ! ? ? ? ? lower_eh_constructs_1 (state, finally);
>
> ? ? ? ? ?emit_post_landing_pad (&eh_seq, tf->region);
> ? ? ? ? ?gimple_seq_add_seq (&eh_seq, finally);
> --- 1382,1388 ----
> ? ? ? ?if (tf->may_throw)
> ? ? ? ?{
> ? ? ? ? ?finally = gimple_eh_else_e_body (eh_else);
> ! ? ? ? ? lower_eh_constructs_1 (state, &finally);
>
> ? ? ? ? ?emit_post_landing_pad (&eh_seq, tf->region);
> ? ? ? ? ?gimple_seq_add_seq (&eh_seq, finally);
> *************** lower_try_finally (struct leh_state *sta
> *** 1623,1629 ****
> ? ?old_eh_seq = eh_seq;
> ? ?eh_seq = NULL;
>
> ! ? lower_eh_constructs_1 (&this_state, gimple_try_eval(tp));
>
> ? ?/* Determine if the try block is escaped through the bottom. ?*/
> ? ?this_tf.may_fallthru = gimple_seq_may_fallthru (gimple_try_eval (tp));
> --- 1623,1629 ----
> ? ?old_eh_seq = eh_seq;
> ? ?eh_seq = NULL;
>
> ! ? lower_eh_constructs_1 (&this_state, gimple_try_eval_ptr (tp));
>
> ? ?/* Determine if the try block is escaped through the bottom. ?*/
> ? ?this_tf.may_fallthru = gimple_seq_may_fallthru (gimple_try_eval (tp));
> *************** lower_catch (struct leh_state *state, gi
> *** 1706,1712 ****
> ? ?struct leh_state this_state = *state;
> ? ?gimple_stmt_iterator gsi;
> ? ?tree out_label;
> ! ? gimple_seq new_seq;
> ? ?gimple x;
> ? ?location_t try_catch_loc = gimple_location (tp);
>
> --- 1706,1712 ----
> ? ?struct leh_state this_state = *state;
> ? ?gimple_stmt_iterator gsi;
> ? ?tree out_label;
> ! ? gimple_seq new_seq, cleanup;
> ? ?gimple x;
> ? ?location_t try_catch_loc = gimple_location (tp);
>
> *************** lower_catch (struct leh_state *state, gi
> *** 1716,1722 ****
> ? ? ? ?this_state.cur_region = try_region;
> ? ? ?}
>
> ! ? lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
>
> ? ?if (!eh_region_may_contain_throw (try_region))
> ? ? ?return gimple_try_eval (tp);
> --- 1716,1722 ----
> ? ? ? ?this_state.cur_region = try_region;
> ? ? ?}
>
> ! ? lower_eh_constructs_1 (&this_state, gimple_try_eval_ptr (tp));
>
> ? ?if (!eh_region_may_contain_throw (try_region))
> ? ? ?return gimple_try_eval (tp);
> *************** lower_catch (struct leh_state *state, gi
> *** 1729,1735 ****
> ? ?this_state.ehp_region = try_region;
>
> ? ?out_label = NULL;
> ! ? for (gsi = gsi_start (gimple_try_cleanup (tp));
> ? ? ? ? !gsi_end_p (gsi);
> ? ? ? ? gsi_next (&gsi))
> ? ? ?{
> --- 1729,1736 ----
> ? ?this_state.ehp_region = try_region;
>
> ? ?out_label = NULL;
> ! ? cleanup = gimple_try_cleanup (tp);
> ! ? for (gsi = gsi_start (cleanup);
> ? ? ? ? !gsi_end_p (gsi);
> ? ? ? ? gsi_next (&gsi))
> ? ? ?{
> *************** lower_catch (struct leh_state *state, gi
> *** 1741,1747 ****
> ? ? ? ?c = gen_eh_region_catch (try_region, gimple_catch_types (gcatch));
>
> ? ? ? ?handler = gimple_catch_handler (gcatch);
> ! ? ? ? lower_eh_constructs_1 (&this_state, handler);
>
> ? ? ? ?c->label = create_artificial_label (UNKNOWN_LOCATION);
> ? ? ? ?x = gimple_build_label (c->label);
> --- 1742,1748 ----
> ? ? ? ?c = gen_eh_region_catch (try_region, gimple_catch_types (gcatch));
>
> ? ? ? ?handler = gimple_catch_handler (gcatch);
> ! ? ? ? lower_eh_constructs_1 (&this_state, &handler);
>
> ? ? ? ?c->label = create_artificial_label (UNKNOWN_LOCATION);
> ? ? ? ?x = gimple_build_label (c->label);
> *************** lower_eh_filter (struct leh_state *state
> *** 1787,1793 ****
> ? ? ? ?this_state.cur_region = this_region;
> ? ? ?}
>
> ! ? lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
>
> ? ?if (!eh_region_may_contain_throw (this_region))
> ? ? ?return gimple_try_eval (tp);
> --- 1788,1794 ----
> ? ? ? ?this_state.cur_region = this_region;
> ? ? ?}
>
> ! ? lower_eh_constructs_1 (&this_state, gimple_try_eval_ptr (tp));
>
> ? ?if (!eh_region_may_contain_throw (this_region))
> ? ? ?return gimple_try_eval (tp);
> *************** lower_eh_filter (struct leh_state *state
> *** 1803,1809 ****
> ? ?x = gimple_build_label (this_region->u.allowed.label);
> ? ?gimple_seq_add_stmt (&new_seq, x);
>
> ! ? lower_eh_constructs_1 (&this_state, gimple_eh_filter_failure (inner));
> ? ?gimple_seq_add_seq (&new_seq, gimple_eh_filter_failure (inner));
>
> ? ?gimple_try_set_cleanup (tp, new_seq);
> --- 1804,1810 ----
> ? ?x = gimple_build_label (this_region->u.allowed.label);
> ? ?gimple_seq_add_stmt (&new_seq, x);
>
> ! ? lower_eh_constructs_1 (&this_state, gimple_eh_filter_failure_ptr (inner));
> ? ?gimple_seq_add_seq (&new_seq, gimple_eh_filter_failure (inner));
>
> ? ?gimple_try_set_cleanup (tp, new_seq);
> *************** lower_eh_must_not_throw (struct leh_stat
> *** 1838,1844 ****
> ? ? ? ?this_state.cur_region = this_region;
> ? ? ?}
>
> ! ? lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
>
> ? ?return gimple_try_eval (tp);
> ?}
> --- 1839,1845 ----
> ? ? ? ?this_state.cur_region = this_region;
> ? ? ?}
>
> ! ? lower_eh_constructs_1 (&this_state, gimple_try_eval_ptr (tp));
>
> ? ?return gimple_try_eval (tp);
> ?}
> *************** lower_cleanup (struct leh_state *state,
> *** 1861,1867 ****
> ? ? ? ?this_state.cur_region = this_region;
> ? ? ?}
>
> ! ? lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
>
> ? ?if (cleanup_dead || !eh_region_may_contain_throw (this_region))
> ? ? ?return gimple_try_eval (tp);
> --- 1862,1868 ----
> ? ? ? ?this_state.cur_region = this_region;
> ? ? ?}
>
> ! ? lower_eh_constructs_1 (&this_state, gimple_try_eval_ptr (tp));
>
> ? ?if (cleanup_dead || !eh_region_may_contain_throw (this_region))
> ? ? ?return gimple_try_eval (tp);
> *************** lower_cleanup (struct leh_state *state,
> *** 1881,1887 ****
> ? ? ?{
> ? ? ? ?/* In this case honor_protect_cleanup_actions had nothing to do,
> ? ? ? ? and we should process this normally. ?*/
> ! ? ? ? lower_eh_constructs_1 (state, gimple_try_cleanup (tp));
> ? ? ? ?result = frob_into_branch_around (tp, this_region,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?fake_tf.fallthru_label);
> ? ? ?}
> --- 1882,1888 ----
> ? ? ?{
> ? ? ? ?/* In this case honor_protect_cleanup_actions had nothing to do,
> ? ? ? ? and we should process this normally. ?*/
> ! ? ? ? lower_eh_constructs_1 (state, gimple_try_cleanup_ptr (tp));
> ? ? ? ?result = frob_into_branch_around (tp, this_region,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?fake_tf.fallthru_label);
> ? ? ?}
> *************** lower_eh_constructs_2 (struct leh_state
> *** 2010,2016 ****
> ? ? ? ? ?if (!x)
> ? ? ? ? ? ?{
> ? ? ? ? ? ? ?replace = gimple_try_eval (stmt);
> ! ? ? ? ? ? ? lower_eh_constructs_1 (state, replace);
> ? ? ? ? ? ?}
> ? ? ? ? ?else
> ? ? ? ? ? ?switch (gimple_code (x))
> --- 2011,2017 ----
> ? ? ? ? ?if (!x)
> ? ? ? ? ? ?{
> ? ? ? ? ? ? ?replace = gimple_try_eval (stmt);
> ! ? ? ? ? ? ? lower_eh_constructs_1 (state, &replace);
> ? ? ? ? ? ?}
> ? ? ? ? ?else
> ? ? ? ? ? ?switch (gimple_code (x))
> *************** lower_eh_constructs_2 (struct leh_state
> *** 2057,2066 ****
> ?/* A helper to unwrap a gimple_seq and feed stmts to lower_eh_constructs_2. */
>
> ?static void
> ! lower_eh_constructs_1 (struct leh_state *state, gimple_seq seq)
> ?{
> ? ?gimple_stmt_iterator gsi;
> ! ? for (gsi = gsi_start (seq); !gsi_end_p (gsi);)
> ? ? ?lower_eh_constructs_2 (state, &gsi);
> ?}
>
> --- 2058,2067 ----
> ?/* A helper to unwrap a gimple_seq and feed stmts to lower_eh_constructs_2. */
>
> ?static void
> ! lower_eh_constructs_1 (struct leh_state *state, gimple_seq *pseq)
> ?{
> ? ?gimple_stmt_iterator gsi;
> ! ? for (gsi = gsi_start (*pseq); !gsi_end_p (gsi);)
> ? ? ?lower_eh_constructs_2 (state, &gsi);
> ?}
>
> *************** lower_eh_constructs (void)
> *** 2079,2085 ****
> ? ?memset (&null_state, 0, sizeof (null_state));
>
> ? ?collect_finally_tree_1 (bodyp, NULL);
> ! ? lower_eh_constructs_1 (&null_state, bodyp);
>
> ? ?/* We assume there's a return statement, or something, at the end of
> ? ? ? the function, and thus ploping the EH sequence afterward won't
> --- 2080,2087 ----
> ? ?memset (&null_state, 0, sizeof (null_state));
>
> ? ?collect_finally_tree_1 (bodyp, NULL);
> ! ? lower_eh_constructs_1 (&null_state, &bodyp);
> ! ? gimple_set_body (current_function_decl, bodyp);
>
> ? ?/* We assume there's a return statement, or something, at the end of
> ? ? ? the function, and thus ploping the EH sequence afterward won't
> *************** optimize_double_finally (gimple one, gim
> *** 2876,2883 ****
> ?{
> ? ?gimple oneh;
> ? ?gimple_stmt_iterator gsi;
>
> ! ? gsi = gsi_start (gimple_try_cleanup (one));
> ? ?if (!gsi_one_before_end_p (gsi))
> ? ? ?return;
>
> --- 2878,2887 ----
> ?{
> ? ?gimple oneh;
> ? ?gimple_stmt_iterator gsi;
> + ? gimple_seq cleanup;
>
> ! ? cleanup = gimple_try_cleanup (one);
> ! ? gsi = gsi_start (cleanup);
> ? ?if (!gsi_one_before_end_p (gsi))
> ? ? ?return;
>
> Index: tree-ssa-dse.c
> ===================================================================
> *** tree-ssa-dse.c.orig 2012-05-01 22:43:31.000000000 +0200
> --- tree-ssa-dse.c ? ? ?2012-05-01 22:43:34.000000000 +0200
> *************** dse_enter_block (struct dom_walk_data *w
> *** 277,283 ****
> ?{
> ? ?gimple_stmt_iterator gsi;
>
> ! ? for (gsi = gsi_last (bb_seq (bb)); !gsi_end_p (gsi); gsi_prev (&gsi))
> ? ? ?dse_optimize_stmt (gsi);
> ?}
>
> --- 277,283 ----
> ?{
> ? ?gimple_stmt_iterator gsi;
>
> ! ? for (gsi = gsi_last_bb (bb); !gsi_end_p (gsi); gsi_prev (&gsi))
> ? ? ?dse_optimize_stmt (gsi);
> ?}
>
> Index: function.h
> ===================================================================
> *** function.h.orig ? ? 2012-05-01 22:43:31.000000000 +0200
> --- function.h ?2012-05-01 22:43:34.000000000 +0200
> *************** struct GTY(()) function {
> *** 507,513 ****
> ? ?struct control_flow_graph *cfg;
>
> ? ?/* GIMPLE body for this function. ?*/
> ! ? struct gimple_seq_d *gimple_body;
>
> ? ?/* SSA and dataflow information. ?*/
> ? ?struct gimple_df *gimple_df;
> --- 507,513 ----
> ? ?struct control_flow_graph *cfg;
>
> ? ?/* GIMPLE body for this function. ?*/
> ! ? gimple_seq gimple_body;
>
> ? ?/* SSA and dataflow information. ?*/
> ? ?struct gimple_df *gimple_df;
> Index: tree-cfg.c
> ===================================================================
> *** tree-cfg.c.orig ? ? 2012-05-01 22:43:31.000000000 +0200
> --- tree-cfg.c ?2012-05-02 01:53:31.000000000 +0200
> *************** make_blocks (gimple_seq seq)
> *** 377,383 ****
> ? ? ? ?if (start_new_block || stmt_starts_bb_p (stmt, prev_stmt))
> ? ? ? ?{
> ? ? ? ? ?if (!first_stmt_of_seq)
> ! ? ? ? ? ? seq = gsi_split_seq_before (&i);
> ? ? ? ? ?bb = create_basic_block (seq, NULL, bb);
> ? ? ? ? ?start_new_block = false;
> ? ? ? ?}
> --- 377,383 ----
> ? ? ? ?if (start_new_block || stmt_starts_bb_p (stmt, prev_stmt))
> ? ? ? ?{
> ? ? ? ? ?if (!first_stmt_of_seq)
> ! ? ? ? ? ? gsi_split_seq_before (&i, &seq);
> ? ? ? ? ?bb = create_basic_block (seq, NULL, bb);
> ? ? ? ? ?start_new_block = false;
> ? ? ? ?}
> *************** static void
> *** 1655,1661 ****
> ?gimple_merge_blocks (basic_block a, basic_block b)
> ?{
> ? ?gimple_stmt_iterator last, gsi, psi;
> - ? gimple_seq phis = phi_nodes (b);
>
> ? ?if (dump_file)
> ? ? ?fprintf (dump_file, "Merging blocks %d and %d\n", a->index, b->index);
> --- 1655,1660 ----
> *************** gimple_merge_blocks (basic_block a, basi
> *** 1663,1669 ****
> ? ?/* Remove all single-valued PHI nodes from block B of the form
> ? ? ? V_i = PHI <V_j> by propagating V_j to all the uses of V_i. ?*/
> ? ?gsi = gsi_last_bb (a);
> ! ? for (psi = gsi_start (phis); !gsi_end_p (psi); )
> ? ? ?{
> ? ? ? ?gimple phi = gsi_stmt (psi);
> ? ? ? ?tree def = gimple_phi_result (phi), use = gimple_phi_arg_def (phi, 0);
> --- 1662,1668 ----
> ? ?/* Remove all single-valued PHI nodes from block B of the form
> ? ? ? V_i = PHI <V_j> by propagating V_j to all the uses of V_i. ?*/
> ? ?gsi = gsi_last_bb (a);
> ! ? for (psi = gsi_start_phis (b); !gsi_end_p (psi); )
> ? ? ?{
> ? ? ? ?gimple phi = gsi_stmt (psi);
> ? ? ? ?tree def = gimple_phi_result (phi), use = gimple_phi_arg_def (phi, 0);
> *************** gimple_split_block (basic_block bb, void
> *** 5249,5255 ****
> ? ? ? brings ugly quadratic memory consumption in the inliner.
> ? ? ? (We are still quadratic since we need to update stmt BB pointers,
> ? ? ? sadly.) ?*/
> ! ? list = gsi_split_seq_before (&gsi);
> ? ?set_bb_seq (new_bb, list);
> ? ?for (gsi_tgt = gsi_start (list);
> ? ? ? ? !gsi_end_p (gsi_tgt); gsi_next (&gsi_tgt))
> --- 5248,5254 ----
> ? ? ? brings ugly quadratic memory consumption in the inliner.
> ? ? ? (We are still quadratic since we need to update stmt BB pointers,
> ? ? ? sadly.) ?*/
> ! ? gsi_split_seq_before (&gsi, &list);
> ? ?set_bb_seq (new_bb, list);
> ? ?for (gsi_tgt = gsi_start (list);
> ? ? ? ? !gsi_end_p (gsi_tgt); gsi_next (&gsi_tgt))
> *************** move_stmt_r (gimple_stmt_iterator *gsi_p
> *** 6085,6092 ****
> ? ? ? ? ?p->remap_decls_p = false;
> ? ? ? ? ?*handled_ops_p = true;
>
> ! ? ? ? ? walk_gimple_seq (gimple_omp_body (stmt), move_stmt_r,
> ! ? ? ? ? ? ? ? ? ? ? ? ? ?move_stmt_op, wi);
>
> ? ? ? ? ?p->remap_decls_p = save_remap_decls_p;
> ? ? ? ?}
> --- 6084,6091 ----
> ? ? ? ? ?p->remap_decls_p = false;
> ? ? ? ? ?*handled_ops_p = true;
>
> ! ? ? ? ? walk_gimple_seq_mod (gimple_omp_body_ptr (stmt), move_stmt_r,
> ! ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?move_stmt_op, wi);
>
> ? ? ? ? ?p->remap_decls_p = save_remap_decls_p;
> ? ? ? ?}
> Index: cgraphbuild.c
> ===================================================================
> *** cgraphbuild.c.orig ?2012-05-01 22:43:31.000000000 +0200
> --- cgraphbuild.c ? ? ? 2012-05-01 22:43:34.000000000 +0200
> *************** build_cgraph_edges (void)
> *** 348,354 ****
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?IPA_REF_ADDR, stmt);
> ? ? ? ? ? ?}
> ? ? ? ?}
> ! ? ? ? for (gsi = gsi_start (phi_nodes (bb)); !gsi_end_p (gsi); gsi_next (&gsi))
> ? ? ? ?walk_stmt_load_store_addr_ops (gsi_stmt (gsi), node,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? mark_load, mark_store, mark_address);
> ? ? }
> --- 348,354 ----
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?IPA_REF_ADDR, stmt);
> ? ? ? ? ? ?}
> ? ? ? ?}
> ! ? ? ? for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
> ? ? ? ?walk_stmt_load_store_addr_ops (gsi_stmt (gsi), node,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? mark_load, mark_store, mark_address);
> ? ? }
> *************** rebuild_cgraph_edges (void)
> *** 440,446 ****
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? mark_store, mark_address);
>
> ? ? ? ?}
> ! ? ? ? for (gsi = gsi_start (phi_nodes (bb)); !gsi_end_p (gsi); gsi_next (&gsi))
> ? ? ? ?walk_stmt_load_store_addr_ops (gsi_stmt (gsi), node,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? mark_load, mark_store, mark_address);
> ? ? ?}
> --- 440,446 ----
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? mark_store, mark_address);
>
> ? ? ? ?}
> ! ? ? ? for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
> ? ? ? ?walk_stmt_load_store_addr_ops (gsi_stmt (gsi), node,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? mark_load, mark_store, mark_address);
> ? ? ?}
> *************** cgraph_rebuild_references (void)
> *** 474,480 ****
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? mark_store, mark_address);
>
> ? ? ? ?}
> ! ? ? ? for (gsi = gsi_start (phi_nodes (bb)); !gsi_end_p (gsi); gsi_next (&gsi))
> ? ? ? ?walk_stmt_load_store_addr_ops (gsi_stmt (gsi), node,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? mark_load, mark_store, mark_address);
> ? ? ?}
> --- 474,480 ----
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? mark_store, mark_address);
>
> ? ? ? ?}
> ! ? ? ? for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
> ? ? ? ?walk_stmt_load_store_addr_ops (gsi_stmt (gsi), node,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? mark_load, mark_store, mark_address);
> ? ? ?}
> Index: cgraphunit.c
> ===================================================================
> *** cgraphunit.c.orig ? 2012-05-01 22:43:31.000000000 +0200
> --- cgraphunit.c ? ? ? ?2012-05-01 22:43:34.000000000 +0200
> *************** cgraph_analyze_function (struct cgraph_n
> *** 646,652 ****
> ? ? ? ? function we lower it, which will require gimplified nested
> ? ? ? ? functions, so we can end up here with an already gimplified
> ? ? ? ? body. ?*/
> ! ? ? ? if (!gimple_body (decl))
> ? ? ? ?gimplify_function_tree (decl);
> ? ? ? ?dump_function (TDI_generic, decl);
>
> --- 646,652 ----
> ? ? ? ? function we lower it, which will require gimplified nested
> ? ? ? ? functions, so we can end up here with an already gimplified
> ? ? ? ? body. ?*/
> ! ? ? ? if (!gimple_has_body_p (decl))
> ? ? ? ?gimplify_function_tree (decl);
> ? ? ? ?dump_function (TDI_generic, decl);
>
> Index: ipa-prop.c
> ===================================================================
> *** ipa-prop.c.orig ? ? 2012-05-01 22:43:31.000000000 +0200
> --- ipa-prop.c ?2012-05-01 22:43:34.000000000 +0200
> *************** ipa_analyze_params_uses (struct cgraph_n
> *** 1626,1632 ****
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? visit_ref_for_mod_analysis,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? visit_ref_for_mod_analysis);
> ? ? ? ?}
> ! ? ? ? for (gsi = gsi_start (phi_nodes (bb)); !gsi_end_p (gsi); gsi_next (&gsi))
> ? ? ? ?walk_stmt_load_store_addr_ops (gsi_stmt (gsi), info,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? visit_ref_for_mod_analysis,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? visit_ref_for_mod_analysis,
> --- 1626,1632 ----
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? visit_ref_for_mod_analysis,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? visit_ref_for_mod_analysis);
> ? ? ? ?}
> ! ? ? ? for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
> ? ? ? ?walk_stmt_load_store_addr_ops (gsi_stmt (gsi), info,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? visit_ref_for_mod_analysis,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? visit_ref_for_mod_analysis,
> Index: tree-inline.c
> ===================================================================
> *** tree-inline.c.orig ?2012-05-01 22:43:31.000000000 +0200
> --- tree-inline.c ? ? ? 2012-05-01 22:43:34.000000000 +0200
> *************** copy_phis_for_bb (basic_block bb, copy_b
> *** 1996,2002 ****
> ? ?edge new_edge;
> ? ?bool inserted = false;
>
> ! ? for (si = gsi_start (phi_nodes (bb)); !gsi_end_p (si); gsi_next (&si))
> ? ? ?{
> ? ? ? ?tree res, new_res;
> ? ? ? ?gimple new_phi;
> --- 1996,2002 ----
> ? ?edge new_edge;
> ? ?bool inserted = false;
>
> ! ? for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
> ? ? ?{
> ? ? ? ?tree res, new_res;
> ? ? ? ?gimple new_phi;
> Index: tree-ssa-dce.c
> ===================================================================
> *** tree-ssa-dce.c.orig 2012-05-01 22:43:31.000000000 +0200
> --- tree-ssa-dce.c ? ? ?2012-05-01 22:43:34.000000000 +0200
> *************** static bool
> *** 1042,1053 ****
> ?remove_dead_phis (basic_block bb)
> ?{
> ? ?bool something_changed = false;
> - ? gimple_seq phis;
> ? ?gimple phi;
> ? ?gimple_stmt_iterator gsi;
> - ? phis = phi_nodes (bb);
>
> ! ? for (gsi = gsi_start (phis); !gsi_end_p (gsi);)
> ? ? ?{
> ? ? ? ?stats.total_phis++;
> ? ? ? ?phi = gsi_stmt (gsi);
> --- 1042,1051 ----
> ?remove_dead_phis (basic_block bb)
> ?{
> ? ?bool something_changed = false;
> ? ?gimple phi;
> ? ?gimple_stmt_iterator gsi;
>
> ! ? for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi);)
> ? ? ?{
> ? ? ? ?stats.total_phis++;
> ? ? ? ?phi = gsi_stmt (gsi);
> Index: gimple-iterator.c
> ===================================================================
> *** gimple-iterator.c.orig ? ? ?2012-05-01 22:43:31.000000000 +0200
> --- gimple-iterator.c ? 2012-05-02 01:53:32.000000000 +0200
> *************** gsi_split_seq_after (gimple_stmt_iterato
> *** 350,360 ****
> ?}
>
>
> ?/* Move all statements in the sequence before I to a new sequence.
> ! ? ?Return this new sequence. ?I is set to the head of the new list. ?*/
>
> ! gimple_seq
> ! gsi_split_seq_before (gimple_stmt_iterator *i)
> ?{
> ? ?gimple_seq_node cur, prev;
> ? ?gimple_seq old_seq, new_seq;
> --- 350,372 ----
> ?}
>
>
> + /* Set the statement to which GSI points to STMT. ?This only updates
> + ? ?the iterator and the gimple sequence, it doesn't do the bookkeeping
> + ? ?of gsi_replace. ?*/
> +
> + void
> + gsi_set_stmt (gimple_stmt_iterator *gsi, gimple stmt)
> + {
> + ? *gsi_stmt_ptr (gsi) = stmt;
> + }
> +
> +
> ?/* Move all statements in the sequence before I to a new sequence.
> ! ? ?Return this new sequence at *PNEW_SEQ.
> ! ? ?I is set to the head of the new list. ?*/
>
> ! void
> ! gsi_split_seq_before (gimple_stmt_iterator *i, gimple_seq *pnew_seq)
> ?{
> ? ?gimple_seq_node cur, prev;
> ? ?gimple_seq old_seq, new_seq;
> *************** gsi_split_seq_before (gimple_stmt_iterat
> *** 381,387 ****
> ? ?else
> ? ? ?gimple_seq_set_first (old_seq, NULL);
>
> ! ? return new_seq;
> ?}
>
>
> --- 393,399 ----
> ? ?else
> ? ? ?gimple_seq_set_first (old_seq, NULL);
>
> ! ? *pnew_seq = new_seq;
> ?}
>
>
> *************** gsi_replace (gimple_stmt_iterator *gsi,
> *** 416,422 ****
> ? ?gimple_remove_stmt_histograms (cfun, orig_stmt);
> ? ?delink_stmt_imm_use (orig_stmt);
>
> ! ? *gsi_stmt_ptr (gsi) = stmt;
> ? ?gimple_set_modified (stmt, true);
> ? ?update_modified_stmt (stmt);
> ?}
> --- 428,434 ----
> ? ?gimple_remove_stmt_histograms (cfun, orig_stmt);
> ? ?delink_stmt_imm_use (orig_stmt);
>
> ! ? gsi_set_stmt (gsi, stmt);
> ? ?gimple_set_modified (stmt, true);
> ? ?update_modified_stmt (stmt);
> ?}


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