From patchwork Wed Apr 19 13:51:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frederik Harwath X-Patchwork-Id: 85415 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp406248vqo; Wed, 19 Apr 2023 06:52:58 -0700 (PDT) X-Google-Smtp-Source: AKy350YHm/mYGvyWmUSYRzvCEid7ehcuP0/hsH8azVUBqP9tFcJCtU05pHGOUln7Jzb5VLwY/A6V X-Received: by 2002:a17:907:1701:b0:932:cec7:6801 with SMTP id le1-20020a170907170100b00932cec76801mr15185781ejc.54.1681912377784; Wed, 19 Apr 2023 06:52:57 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id gg29-20020a170906899d00b0094f6d6786cbsi7512792ejc.404.2023.04.19.06.52.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 06:52:57 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=aYJZlP7j; arc=fail (signature failed); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 513D03857730 for ; Wed, 19 Apr 2023 13:52:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 513D03857730 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681912376; bh=/CLi83Vy0AlB2rmhc6Dc6ypVPztZyOmyUpvHkQ9iN34=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=aYJZlP7jcjFQeH+ZSdcThBbEPyoxZ8uAie5RnzP1dzrgaELRDEu2dkOo14PYT0IBh bcIW0cPs2mbz807YoB+IdZPFzCYomW0ubfuuTkQtp0P/+z1K524hG+8Zx4r2c6rzBJ ej0Kf63nq8QOE9lmDBEXIJx2UhEtmkLkPplkfyv4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2064.outbound.protection.outlook.com [40.107.22.64]) by sourceware.org (Postfix) with ESMTPS id 7B52F3858D33 for ; Wed, 19 Apr 2023 13:52:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7B52F3858D33 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gUPN2SNcmZzfvtISwe96CG0UGmSbezYrP9RWeievXBHjEIk4JkKFMHroqPhHa+9R8avl66d90VEh6biW7EaQiE0bngCtnq3g94g+ynOvMHTfCdQ8hRI+7zw1GQPSwKq/worHegbEFZIsl8TaK1PF7LKrCjesfj1iEvlPVJ4giyf74EjElwZR698Va1nl6cUjJWW+Hd3WVXE+Vpu+dMh06TIWc9DrZKNg2HvD+YtC+2pykWYoTVXJhlj8asYz9l7/3ZOk1JzmHTVgwCwV4CrAEhMLJIj30AQuRYHRyZMu8R+7N3HjxbdUPG6HDV2yfY1dJliEqm9GiX3hyfAgne/+qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/CLi83Vy0AlB2rmhc6Dc6ypVPztZyOmyUpvHkQ9iN34=; b=HAvrElmbeEufDkP2Fe5hJSVKTwOIwkK0Lih/yBoSX5GSOxBPm8sbDPJc/KwMWVDEk1ZoNWAVf/JSU+1BpyoXnH6aowzi+4h3kSBG09bUkWMPRohxN49bv9ygWzIpudprzKh7HgpP/ts/f9pu6NxQ583mUo5/Bwu9cpDN6OciSerjueMXv3u4hpb3ieXZyOm/V389Hq1T32PaLHl5z793u7TxCyj6BZMm4l1d2NnzbvjPrx13bFO3RVzPdEcropCotnScIwjIXloh33I8AsD4BrdOj2GiU0VPbKA/z/AfLJlQoOtb1chhJPFNt1yn97wF5PxtvlfUTMmw5TNzZxAN0w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=siemens.com; dmarc=pass action=none header.from=siemens.com; dkim=pass header.d=siemens.com; arc=none Received: from AM9PR10MB4824.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:413::23) by DUZPR10MB8149.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:4dc::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.20; Wed, 19 Apr 2023 13:52:07 +0000 Received: from AM9PR10MB4824.EURPRD10.PROD.OUTLOOK.COM ([fe80::8b5c:f06d:7132:891c]) by AM9PR10MB4824.EURPRD10.PROD.OUTLOOK.COM ([fe80::8b5c:f06d:7132:891c%3]) with mapi id 15.20.6319.022; Wed, 19 Apr 2023 13:52:07 +0000 Message-ID: <4b1f91dc-dd02-4c05-b457-1a9005e85d16@siemens.com> Date: Wed, 19 Apr 2023 15:51:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: [PATCH] Docs, OpenMP: Small fixes to internal OMP_FOR doc To: Sandra Loosemore , gcc-patches@gcc.gnu.org X-ClientProxiedBy: FR0P281CA0092.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a9::13) To AM9PR10MB4824.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:413::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR10MB4824:EE_|DUZPR10MB8149:EE_ X-MS-Office365-Filtering-Correlation-Id: b6d2b136-2da3-4e7d-7741-08db40dd43ee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q45kaH1GOtWJDdRt2VHDLdIM6glX6FbQK0RlK2Ob85ioSBhV6yuzOkEZJOz6TH7V0GFLWOofBHtqDGdEMU8tR+ofwSWvBD0qFZfuxA0Glm8OMMK0rsqhuKjSx46UPna3eZhd20GgUqUx9T3YbZO20Bf4TMLHwTfIKfsM3z9R4BYexhG8mlUYOD8ELLdxenIfDIZhQjC/BgdRpFswgMIBeUN4PMBJIJzzlqQq4+54j7ugVHtyVcgThJmygz3OZOI7LcI/PXPUwL6+bAL5Ad7wHpZoVtTGXdyJ+aTUW/IWc/5icr8qe0K5tfBUxVHvTjX92JtgbE/14E+mAIZo63xOx/hGjO58UFfj7eHlUYQ0yEBcocizNIwlhm0InT9qj6VvrmqJ7FcMqXneG8dGEy+nnXbWsbqz7F9cD6l5v3v1hTU2YQblWelzUgtVwy05toOlKa2YqcjOJM/pQyc1MlRxPMW3t2foJYbT1tN8oai2V/aKf3HwXdlzOhP4rJS59NmymE6JYa2HRLzUdLaxI9kaQRuChDjH97R3aVrpWlP9Yiqkx501fz+bbrAs2fxG8P0uiOVC/rTKmZY5shKvzJ7efM0oaVLvfKQAe+JIa2PMryVIGltxTOtFFmFgZGfibR+sQ69hXO3Gb3CHks/z4lT43g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR10MB4824.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230028)(4636009)(366004)(396003)(39860400002)(136003)(346002)(376002)(451199021)(6666004)(2906002)(66476007)(66946007)(6486002)(33964004)(44832011)(36756003)(316002)(8676002)(8936002)(41300700001)(38100700002)(5660300002)(235185007)(66556008)(82960400001)(478600001)(31696002)(6512007)(6506007)(2616005)(31686004)(186003)(86362001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?zfe7rjJsbAIC9VgQq2PLdRl/skTJ?= =?utf-8?q?Tx1m829yzzfqajYE2fiyD22Byb63UXnxpcZcu2KPvbSqMjKlcf2Yhete47/JNtmjk?= =?utf-8?q?naJyacvgaCNa69w09jlEM0/9fPKCsoPJUG/VCQadNm8NwaZoBTKCHQFyWcbSMbzLw?= =?utf-8?q?S0PErjditGtQrCbUJ2O0WqmD8bwdxGsKmYfaLqMB82f6DQt39xpZdOpABOnCWn1Xv?= =?utf-8?q?t8j2ab6EeuKCnT8fSYdVQdrP+q7Ynb8fnjxm1kaGK9BSfafagIZEiHNzzXJng1k2x?= =?utf-8?q?Hioj3wugNU4/Z9gKRhhzXHPGBf0cfBPG5PAdWnwYcRgXacHG/PzWvMcVICQFJs6XQ?= =?utf-8?q?iCLqNQtFuIerNBD2sLzZNP/s0V8tAaduXY8EVFiQzuKLa70cNuMhxyE2l5KGbIqXC?= =?utf-8?q?2GueAJlo+1RqHFdUbI8rK307EBXqkwDyf3SWqXHL8kXm7H/ROno/KWcsuDGJDEsJw?= =?utf-8?q?RJ0OXBo3uLeFDEvnuAYA3V5nTyaqHd9MhGJeUTXs4IHLDd8z6plUhYJzhabLGZraA?= =?utf-8?q?s8tdQEOR5PI0Btc8dxq/L7OCHTTpnkJApAs4deoK7xuGhzEY8UXqsKW4gq3ISkSKs?= =?utf-8?q?pHLYE3ee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Z+U+D95PI3GJXcb/jX64nSE42FW7WTsI4GmSWdC1?= =?utf-8?q?BWm7c/DkbBhOJAaVsGp1L+JVELIYgrqi5448QZX2BDk8Yw7LaOzEZfs7P2Rwp22Ht?= =?utf-8?q?p6AuZjq1Jn5vJr6pv1xUXX9N3OofvabrA=3D=3D?= X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-Network-Message-Id: b6d2b136-2da3-4e7d-7741-08db40dd43ee X-MS-Exchange-CrossTenant-AuthSource: AM9PR10MB4824.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2023 13:52:07.7249 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: F6yxX/lfkM8OvHst0SMPHZyaU3yZM/1ZdADbNSFz0Lb0tvtbuWFems6W84BWMU2eXvD0qfh6qttoj28jTaHOe8RHrAY/8HXYi73duOi4/FU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DUZPR10MB8149 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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-Patchwork-Original-From: Frederik Harwath via Gcc-patches From: Frederik Harwath Reply-To: Frederik Harwath Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763612953073148783?= X-GMAIL-MSGID: =?utf-8?q?1763612953073148783?= Hi Sandra, the OMP_FOR documentation says that the loop index variable must be signed and it does not list "!=" in the allowed conditional expressions. But there is nothing that would automatically cast an unsigned variable to signed or that converts the "!=" as you can see from the dump for this program: int main () { #pragma omp for for (unsigned i = 0; i != 10; i++) {} } The 005t.gimple dump is: int __GIMPLE () {   int D_2064;   {     {       unsigned int i;       #pragma omp for private(i)       for (i = 0u; i != 10u; i = i + 1u)     }   }   D_2064 = 0;   return D_2064; } (Strictly speaking, the OMP_FOR is represented as a gomp_for at this point, but this does not really matter.) Can I commit the patch? Best regards, Frederik From 8af01114c295086526a67f56f6256fc945b1ccb5 Mon Sep 17 00:00:00 2001 From: Frederik Harwath Date: Wed, 19 Apr 2023 13:18:55 +0200 Subject: [PATCH] Docs, OpenMP: Small fixes to internal OMP_FOR doc. gcc/ChangeLog: * doc/generic.texi (OpenMP): Add != to allowed conditions and state that vars can be unsigned. * tree.def (OMP_FOR): Likewise. --- gcc/doc/generic.texi | 4 ++-- gcc/tree.def | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/doc/generic.texi b/gcc/doc/generic.texi index 2c14b7abce2..8b2882da4fe 100644 --- a/gcc/doc/generic.texi +++ b/gcc/doc/generic.texi @@ -2323,7 +2323,7 @@ Operand @code{OMP_FOR_INIT} is a vector containing iteration variable initializations of the form @code{VAR = N1}. Operand @code{OMP_FOR_COND} is vector containing loop -conditional expressions of the form @code{VAR @{<,>,<=,>=@} N2}. +conditional expressions of the form @code{VAR @{<,>,<=,>=,!=@} N2}. Operand @code{OMP_FOR_INCR} is a vector containing loop index increment expressions of the form @code{VAR @{+=,-=@} INCR}. @@ -2349,7 +2349,7 @@ adjust their data-sharing attributes and diagnose errors. @code{OMP_FOR_ORIG_DECLS} is a vector field, with each element holding a list of @code{VAR_DECLS} for the corresponding collapse level. -The loop index variable @code{VAR} must be a signed integer variable, +The loop index variable @code{VAR} must be an integer variable, which is implicitly private to each thread. For rectangular loops, the bounds @code{N1} and @code{N2} and the increment expression @code{INCR} are required to be loop-invariant integer expressions diff --git a/gcc/tree.def b/gcc/tree.def index ee02754354f..90ceeec0b51 100644 --- a/gcc/tree.def +++ b/gcc/tree.def @@ -1159,7 +1159,7 @@ DEFTREECODE (OMP_TASK, "omp_task", tcc_statement, 2) variable initializations of the form VAR = N1. Operand 3: OMP_FOR_COND is vector containing loop - conditional expressions of the form VAR {<,>,<=,>=} N2. + conditional expressions of the form VAR {<,>,<=,>=,!=} N2. Operand 4: OMP_FOR_INCR is a vector containing loop index increment expressions of the form VAR {+=,-=} INCR. @@ -1185,7 +1185,7 @@ DEFTREECODE (OMP_TASK, "omp_task", tcc_statement, 2) OMP_FOR_ORIG_DECLS is a vector field, with each element holding a list of VAR_DECLS for the corresponding collapse level. - The loop index variable VAR must be a signed integer variable, + The loop index variable VAR must be an integer variable, which is implicitly private to each thread. For rectangular loops, the bounds N1 and N2 and the increment expression INCR are required to be loop-invariant integer expressions -- 2.36.1