Fix remove_stmt in vectorizable_simd_clone_call (PR 86758)
authorRichard Sandiford <richard.sandiford@arm.com>
Wed, 1 Aug 2018 15:29:36 +0000 (15:29 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Wed, 1 Aug 2018 15:29:36 +0000 (15:29 +0000)
vectorizable_simd_clone_call was trying to remove a pattern statement
instead of the original statement,  Fixes existing tests
gcc.dg/pr84452.c and gcc.target/i386/pr84309.c on x86.

2018-08-01  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR tree-optimization/86748
* tree-vect-stmts.c (vectorizable_simd_clone_call): Don't try
to remove pattern statements.

From-SVN: r263222

gcc/ChangeLog
gcc/tree-vect-stmts.c

index 3e7367de13ac334301f77d790ba7b6efe1b7b1ce..6ea9771a079f2cd8dfc57c343dd39b21f62a3e0a 100644 (file)
@@ -1,3 +1,9 @@
+2018-08-01  Richard Sandiford  <richard.sandiford@arm.com>
+
+       PR tree-optimization/86748
+       * tree-vect-stmts.c (vectorizable_simd_clone_call): Don't try
+       to remove pattern statements.
+
 2018-08-01  Richard Sandiford  <richard.sandiford@arm.com>
 
        * tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Use the
index 3989fdea251a66712da58c101481dbe323f5a1d4..cfc8388384411a50a80a0456b3cc16aebe413ae0 100644 (file)
@@ -4368,7 +4368,7 @@ vectorizable_simd_clone_call (stmt_vec_info stmt_info,
     }
   else
     new_stmt = gimple_build_nop ();
-  vinfo->replace_stmt (gsi, stmt_info, new_stmt);
+  vinfo->replace_stmt (gsi, vect_orig_stmt (stmt_info), new_stmt);
   unlink_stmt_vdef (stmt);
 
   return true;