From 7a66c4909fd175ba429f39a3ca30be39ea02ae64 Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Sun, 28 Nov 2021 09:39:40 +0100
Subject: [PATCH] d: fix thinko in optimize attr parsing

gcc/d/ChangeLog:

	* d-attribs.cc (parse_optimize_options): Fix thinko.
---
 gcc/d/d-attribs.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/d/d-attribs.cc b/gcc/d/d-attribs.cc
index 1ec800526f7d..b79cf96f55c8 100644
--- a/gcc/d/d-attribs.cc
+++ b/gcc/d/d-attribs.cc
@@ -854,7 +854,7 @@ parse_optimize_options (tree args)
     {
       unsigned opt_index = decoded_options[i].opt_index;
       if (opt_index >= cl_options_count
-	  && ! (cl_options[opt_index].flags & CL_OPTIMIZATION))
+	  || ! (cl_options[opt_index].flags & CL_OPTIMIZATION))
 	{
 	  ret = false;
 	  warning (OPT_Wattributes,
-- 
GitLab