diff mbox

Fix simd clone vectorization with EH (PR tree-optimization/63915)

Message ID 20141118220846.GU1745@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Nov. 18, 2014, 10:08 p.m. UTC
Hi!

Simd clone vectorization uses vect_finish_stmt_generation which
handles adding the new calls properly to EH tables, but afterwards
we replace the original call with a normal assignment, and if the original
call can throw, we need to remove it from the EH tables.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
ok for trunk?

2014-11-18  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/63915
	* tree-vect-stmts.c (vectorizable_simd_clone_call): Pass
	true instead of false as last argument to gsi_replace.

	* c-c++-common/gomp/pr60823-4.c: New test.


	Jakub

Comments

Richard Biener Nov. 19, 2014, 9:34 a.m. UTC | #1
On Tue, 18 Nov 2014, Jakub Jelinek wrote:

> Hi!
> 
> Simd clone vectorization uses vect_finish_stmt_generation which
> handles adding the new calls properly to EH tables, but afterwards
> we replace the original call with a normal assignment, and if the original
> call can throw, we need to remove it from the EH tables.
> 
> Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
> ok for trunk?

Ok.

Thanks,
Richard.

> 2014-11-18  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR tree-optimization/63915
> 	* tree-vect-stmts.c (vectorizable_simd_clone_call): Pass
> 	true instead of false as last argument to gsi_replace.
> 
> 	* c-c++-common/gomp/pr60823-4.c: New test.
> 
> --- gcc/tree-vect-stmts.c.jj	2014-11-14 00:10:39.000000000 +0100
> +++ gcc/tree-vect-stmts.c	2014-11-18 17:02:15.635257023 +0100
> @@ -3195,7 +3195,7 @@ vectorizable_simd_clone_call (gimple stm
>    set_vinfo_for_stmt (new_stmt, stmt_info);
>    set_vinfo_for_stmt (stmt, NULL);
>    STMT_VINFO_STMT (stmt_info) = new_stmt;
> -  gsi_replace (gsi, new_stmt, false);
> +  gsi_replace (gsi, new_stmt, true);
>    unlink_stmt_vdef (stmt);
>  
>    return true;
> --- gcc/testsuite/c-c++-common/gomp/pr60823-4.c.jj	2014-11-18 17:06:38.859319961 +0100
> +++ gcc/testsuite/c-c++-common/gomp/pr60823-4.c	2014-11-18 17:06:34.602383632 +0100
> @@ -0,0 +1,7 @@
> +/* PR tree-optimization/63915 */
> +/* { dg-do run } */
> +/* { dg-require-effective-target vect_simd_clones } */
> +/* { dg-options "-O2 -fopenmp-simd" } */
> +/* { dg-additional-options "-fpic" { target fpic } } */
> +
> +#include "pr60823-2.c"
> 
> 	Jakub
> 
>
diff mbox

Patch

--- gcc/tree-vect-stmts.c.jj	2014-11-14 00:10:39.000000000 +0100
+++ gcc/tree-vect-stmts.c	2014-11-18 17:02:15.635257023 +0100
@@ -3195,7 +3195,7 @@  vectorizable_simd_clone_call (gimple stm
   set_vinfo_for_stmt (new_stmt, stmt_info);
   set_vinfo_for_stmt (stmt, NULL);
   STMT_VINFO_STMT (stmt_info) = new_stmt;
-  gsi_replace (gsi, new_stmt, false);
+  gsi_replace (gsi, new_stmt, true);
   unlink_stmt_vdef (stmt);
 
   return true;
--- gcc/testsuite/c-c++-common/gomp/pr60823-4.c.jj	2014-11-18 17:06:38.859319961 +0100
+++ gcc/testsuite/c-c++-common/gomp/pr60823-4.c	2014-11-18 17:06:34.602383632 +0100
@@ -0,0 +1,7 @@ 
+/* PR tree-optimization/63915 */
+/* { dg-do run } */
+/* { dg-require-effective-target vect_simd_clones } */
+/* { dg-options "-O2 -fopenmp-simd" } */
+/* { dg-additional-options "-fpic" { target fpic } } */
+
+#include "pr60823-2.c"