Bootstrapped/tested on x86_64-unknown-linux-gnu, applied.

Richard.

2019-05-09  Richard Biener  <rguent...@suse.de>

        PR tree-optimization/90395
        * tree-ssa-forwprop.c (pass_forwprop::execute): Do not
        rewrite vector stores that throw internally.

        * gcc.dg/torture/pr90395.c: New testcase.

Index: gcc/tree-ssa-forwprop.c
===================================================================
--- gcc/tree-ssa-forwprop.c     (revision 271000)
+++ gcc/tree-ssa-forwprop.c     (working copy)
@@ -2570,6 +2570,7 @@ pass_forwprop::execute (function *fun)
              if (single_imm_use (lhs, &use_p, &use_stmt)
                  && gimple_store_p (use_stmt)
                  && !gimple_has_volatile_ops (use_stmt)
+                 && !stmt_can_throw_internal (cfun, use_stmt)
                  && is_gimple_assign (use_stmt)
                  && (TREE_CODE (gimple_assign_lhs (use_stmt))
                      != TARGET_MEM_REF))
Index: gcc/testsuite/gcc.dg/torture/pr90395.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/pr90395.c      (nonexistent)
+++ gcc/testsuite/gcc.dg/torture/pr90395.c      (working copy)
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-fexceptions -fnon-call-exceptions" } */
+
+typedef int v16si __attribute__ ((__vector_size__ (64)));
+
+void
+rl (int uq)
+{
+  v16si qw[1];
+
+  qw[uq] = (v16si) { uq };
+}

Reply via email to