@@ -2204,7 +2204,8 @@ add_clobbers_to_eh_landing_pad (basic_bl
&& !TREE_THIS_VOLATILE (var)
&& !DECL_HAS_VALUE_EXPR_P (var)
&& !is_gimple_reg (var)
- && auto_var_in_fn_p (var, id->src_fn))
+ && auto_var_in_fn_p (var, id->src_fn)
+ && !lookup_attribute ("omp simd array", DECL_ATTRIBUTES (var)))
{
tree *t = id->decl_map->get (var);
if (!t)
@@ -0,0 +1,22 @@
+! PR tree-optimization/89027
+! { dg-do compile }
+! { dg-additional-options "-O2 -fexceptions -fno-tree-dce" }
+
+subroutine bar
+ integer :: a, b
+ a = 1
+ b = 2
+ call foo
+contains
+ subroutine foo
+!$omp simd linear(a:2) linear(b:1)
+ do a = 1, 20, 2
+ b = b + 1
+ end do
+!$omp end simd
+ if (a /= 21 .or. b /= 12) STOP 1
+!$omp task depend(out : a)
+ a = a + 1
+!$omp end task
+ end subroutine foo
+end subroutine bar