From 7d173111a2ac3c01d52093d41541447f6c1f6f0c Mon Sep 17 00:00:00 2001
From: Joel Hutton <joel.hutton@arm.com>
Date: Tue, 14 Dec 2021 10:16:59 +0000
Subject: [PATCH] vect-loop: fix build

Previous commit broke build as it relied on directly_supported_p which
is not in 11. This reworks to avoid using directly_supported_p.

gcc/ChangeLog:

	PR bootstrap/103688
	* tree-vect-loop.c (vectorizable_induction): Rework to avoid
    directly_supported_p.
---
 gcc/tree-vect-loop.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 54320681119d880ec2cbe641fe16ee73e552f57d..b77b4f7f83f6fd6ce08e9e4b28d804013dd8ff92 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -7997,8 +7997,8 @@ vectorizable_induction (loop_vec_info loop_vinfo,
   tree step_vectype = get_same_sized_vectype (TREE_TYPE (step_expr), vectype);
 
   /* Check for backend support of PLUS/MINUS_EXPR. */
-  if (!directly_supported_p (PLUS_EXPR, step_vectype)
-      || !directly_supported_p (MINUS_EXPR, step_vectype))
+  if (!target_supports_op_p (step_vectype, PLUS_EXPR, optab_default)
+      || !target_supports_op_p (step_vectype, MINUS_EXPR, optab_default))
     return false;
 
   if (!vec_stmt) /* transformation not required.  */
-- 
2.17.1

