From patchwork Fri Apr 3 09:02:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 1265961 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48tv8V3Ldxz9sRN for ; Fri, 3 Apr 2020 20:02:32 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B6190385DC07; Fri, 3 Apr 2020 09:02:29 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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?= =?utf-8?q?_different_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-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: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" 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-grid.c:1070:7: warning: comparison of two values with different enumeration types in switch statement ('enum tree_code' and 'omp_clause_code') [-Wenum-compare-switch] /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang/build/gcc/omp-grid.c:1081:7: warning: comparison of two values with different enumeration types in switch statement ('enum tree_code' and 'omp_clause_code') [-Wenum-compare-switch] /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang/build/gcc/omp-grid.c:1082:7: warning: comparison of two values with different enumeration types in switch statement ('enum tree_code' and 'omp_clause_code') [-Wenum-compare-switch] /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang/build/gcc/omp-grid.c:1083:7: warning: comparison of two values with different enumeration types in switch statement ('enum tree_code' and 'omp_clause_code') [-Wenum-compare-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ße 201, 80634 München / Germany Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter 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;