diff mbox

Dead code in move_stmt_r

Message ID 56056B2B.6010108@t-online.de
State New
Headers show

Commit Message

Bernd Schmidt Sept. 25, 2015, 3:41 p.m. UTC
I noticed this a while ago while trying to defer parts of omp expansion 
until after LTO. move_tree_r, which is used when moving code into omp 
child functions, has code not to remap variables inside an OMP 
directive. However, by the time we get here, these directives should all 
have been expanded already, and the code appears to be dead.

Hence, the following patch. Bootstrapped and tested on x86_64-linux, ok?


Bernd

Comments

Jeff Law Sept. 25, 2015, 3:58 p.m. UTC | #1
On 09/25/2015 09:41 AM, Bernd Schmidt wrote:
> I noticed this a while ago while trying to defer parts of omp expansion
> until after LTO. move_tree_r, which is used when moving code into omp
> child functions, has code not to remap variables inside an OMP
> directive. However, by the time we get here, these directives should all
> have been expanded already, and the code appears to be dead.
>
> Hence, the following patch. Bootstrapped and tested on x86_64-linux, ok?
OK.
jeff
diff mbox

Patch

	* tree-cfg.c (move_stmt_r): Replace dead code with an assert.
	Remove name from now unused argument.

diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 807d96f..5712e8d 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -6557,7 +6557,7 @@  move_stmt_eh_region_tree_nr (tree old_t_nr, struct move_stmt_d *p)
    statement.  */
 
 static tree
-move_stmt_r (gimple_stmt_iterator *gsi_p, bool *handled_ops_p,
+move_stmt_r (gimple_stmt_iterator *gsi_p, bool *,
 	     struct walk_stmt_info *wi)
 {
   struct move_stmt_d *p = (struct move_stmt_d *) wi->info;
@@ -6619,21 +6619,7 @@  move_stmt_r (gimple_stmt_iterator *gsi_p, bool *handled_ops_p,
     case GIMPLE_OMP_CONTINUE:
       break;
     default:
-      if (is_gimple_omp (stmt))
-	{
-	  /* Do not remap variables inside OMP directives.  Variables
-	     referenced in clauses and directive header belong to the
-	     parent function and should not be moved into the child
-	     function.  */
-	  bool save_remap_decls_p = p->remap_decls_p;
-	  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;
-	}
+      gcc_assert (!is_gimple_omp (stmt));
       break;
     }