From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 7FC93385DC01 for ; Fri, 3 Apr 2020 09:02:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7FC93385DC01 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Tobias_Burnus@mentor.com IronPort-SDR: Wvyktrt09EySKdAHqgIsUBqYQgSnEFjGl6vZnWkaD/PP4IVJ0ftNrWDd9FsI5Df9e1G9LNag9+ z5AxwE6H3fx49NRiIc95JR+Hq4EdubWtOOPVXX+rQeN/DUjg6zScesaNJSDgRamBd5LXffcnTO QnfuKJfR7sFiz5SGOFIIrlFc5gPrwsaVbM9ZbDgIO2liuqVp7Rle0NX2cG3paBnsy5tJPKcJOE c281vVhTQDMpmXJwqJg+ARafoZmYr52w3T7EtnsI0Fi2JeP1+LE7yQL6UiUQpZJCu0nyDxodX1 R/o= X-IronPort-AV: E=Sophos;i="5.72,339,1580803200"; d="diff'?scan'208";a="47457476" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 03 Apr 2020 01:02:26 -0800 IronPort-SDR: HH0W/1q5OmizEbqhJ9IWbp4T2xYU106h9GNoveVJ32kTmQH1JFeFL8aGNsUK4OoOTJCJfKH342 p1rWlth6be8Y564KYegCeRw7xtm5Uk2zS3+j5AfUx82Vc0AHFjbMmmWGdtXhaETtiajcQ4kbp7 L4iJIA02daxGdGihBCak9NFdFgew19xa+UOYJIIpcBhfhmkJLcn5vW7Xu4VYYlgnf+vUm55+F0 7P6ASZjrwTs60FemWMdqql7Jtk5jPyfgT246utPoubZxUkPlDKFqAimH2d3muNYpFn5twQaMwW BlI= To: gcc-patches , Jakub Jelinek From: Tobias Burnus Subject: =?UTF-8?Q?=5bPatch=5d_omp-grid=2ec_=e2=80=93_add_cast_to_silence_di?= =?UTF-8?Q?fferent_enumeration_types_warning?= Message-ID: <449b24ed-5395-1050-4c31-4a17807688cc@codesourcery.com> Date: Fri, 3 Apr 2020 11:02:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------957FD1CEE26582FC19F031BC" Content-Language: en-US X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) To SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) X-Spam-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2020 09:02:29 -0000 --------------957FD1CEE26582FC19F031BC Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable Hi, that's based on https://users.suse.com/~mliska/clang-warnings.txt which has for omp-grid.c: /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang/build/gcc/omp-gri= d.c:1070:7: warning: comparison of two values with different enumeration ty= pes in switch statement ('enum tree_code' and 'omp_clause_code') [-Wenum-co= mpare-switch] /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang/build/gcc/omp-gri= d.c:1081:7: warning: comparison of two values with different enumeration ty= pes in switch statement ('enum tree_code' and 'omp_clause_code') [-Wenum-co= mpare-switch] /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang/build/gcc/omp-gri= d.c:1082:7: warning: comparison of two values with different enumeration ty= pes in switch statement ('enum tree_code' and 'omp_clause_code') [-Wenum-co= mpare-switch] /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang/build/gcc/omp-gri= d.c:1083:7: warning: comparison of two values with different enumeration ty= pes in switch statement ('enum tree_code' and 'omp_clause_code') [-Wenum-co= mpare-switch] Those are all for the same switch statement; gomp_for contains 'tree clauses' and this clauses's '->code' is used to handle store 'enum omp_clauses_code' values in in gimple.{h,c}. I think adding this cast (and only this one) makes sense and it also silences a (clang) compiler warning. OK? Tobias ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstra=C3=9Fe 201, 80634 M=C3=BCnch= en / Germany Registergericht M=C3=BCnchen HRB 106955, Gesch=C3=A4ftsf=C3=BChrer: Thomas = Heurung, Alexander Walter --------------957FD1CEE26582FC19F031BC Content-Type: text/x-patch; charset="UTF-8"; name="omp-warn.diff" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="omp-warn.diff" omp-grid.c – add cast to silence different enumeration types warning * omp-grid.c (grid_eliminate_combined_simd_part): Add cast to omp_clause_code to silence compiler warning. diff --git a/gcc/omp-grid.c b/gcc/omp-grid.c index b98e45de6a0..878977da2f9 100644 --- a/gcc/omp-grid.c +++ b/gcc/omp-grid.c @@ -1058,21 +1058,21 @@ grid_eliminate_combined_simd_part (gomp_for *parloop) while (*tgt) tgt = &OMP_CLAUSE_CHAIN (*tgt); /* Copy over all clauses, except for linear clauses, which are turned into private clauses, and all other simd-specific clauses, which are ignored. */ tree *pc = gimple_omp_for_clauses_ptr (simd); while (*pc) { tree c = *pc; - switch (TREE_CODE (c)) + switch ((omp_clause_code) TREE_CODE (c)) { case OMP_CLAUSE_LINEAR: { tree priv = build_omp_clause (UNKNOWN_LOCATION, OMP_CLAUSE_PRIVATE); OMP_CLAUSE_DECL (priv) = OMP_CLAUSE_DECL (c); OMP_CLAUSE_CHAIN (priv) = NULL; *tgt = priv; tgt = &OMP_CLAUSE_CHAIN (priv); pc = &OMP_CLAUSE_CHAIN (c); break; --------------957FD1CEE26582FC19F031BC--