Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/808598/?format=api
{ "id": 808598, "url": "http://patchwork.ozlabs.org/api/1.2/patches/808598/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/2f2d738f-90d7-0efe-1caf-7e3a6387b0eb@daswigwam.de/", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/1.2/projects/17/?format=api", "name": "GNU Compiler Collection", "link_name": "gcc", "list_id": "gcc-patches.gcc.gnu.org", "list_email": "gcc-patches@gcc.gnu.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<2f2d738f-90d7-0efe-1caf-7e3a6387b0eb@daswigwam.de>", "list_archive_url": null, "date": "2017-09-01T09:09:47", "name": "Patch for [Bug fortran/81841] [5/6/7/8 Regression] THREADPRIVATE (OpenMP) wrongly rejected in BLOCK DATA", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "603bae48aab46acaa1752ed8229991e0aa11b81e", "submitter": { "id": 72275, "url": "http://patchwork.ozlabs.org/api/1.2/people/72275/?format=api", "name": "dbroemmel", "email": "dibr-bugzilla@daswigwam.de" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/2f2d738f-90d7-0efe-1caf-7e3a6387b0eb@daswigwam.de/mbox/", "series": [ { "id": 980, "url": "http://patchwork.ozlabs.org/api/1.2/series/980/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=980", "date": "2017-09-01T09:09:47", "name": "Patch for [Bug fortran/81841] [5/6/7/8 Regression] THREADPRIVATE (OpenMP) wrongly rejected in BLOCK DATA", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/980/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/808598/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/808598/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<gcc-patches-return-461257-incoming=patchwork.ozlabs.org@gcc.gnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "mailing list gcc-patches@gcc.gnu.org" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-461257-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"rsfgIS19\"; dkim-atps=neutral", "sourceware.org; auth=none" ], "Received": [ "from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xkD3V2byMz9t32\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 1 Sep 2017 19:10:13 +1000 (AEST)", "(qmail 22663 invoked by alias); 1 Sep 2017 09:09:59 -0000", "(qmail 22631 invoked by uid 89); 1 Sep 2017 09:09:58 -0000", "from mail.daswigwam.de (HELO mail.daswigwam.de) (92.51.130.26) by\n\tsourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tFri, 01 Sep 2017 09:09:52 +0000", "from localhost (localhost [127.0.0.1])\tby mail.daswigwam.de\n\t(Postfix) with ESMTP id 40E321004E0;\n\tFri, 1 Sep 2017 11:09:48 +0200 (CEST)", "from mail.daswigwam.de ([127.0.0.1])\tby localhost\n\t(lvps92-51-130-26.dedicated.hosteurope.de [127.0.0.1])\n\t(amavisd-new, port 10024)\twith LMTP id gl83WvoSWYBo;\n\tFri, 1 Sep 2017 11:09:47 +0200 (CEST)", "from 127.0.0.1 (zam390.zam.kfa-juelich.de [134.94.168.28])\t(using\n\tTLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits))\t(No client certificate requested)\tby mail.daswigwam.de\n\t(Postfix) with ESMTPSA id 8F9D31004D5;\n\tFri, 1 Sep 2017 11:09:47 +0200 (CEST)" ], "DomainKey-Signature": "a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:from\n\t:subject:to:message-id:date:mime-version:content-type; q=dns; s=\n\tdefault; b=iFYktrVUXqUXsa/krgrqsv+D6MGr6GqtsclzjbClJtnLg7f9gN2TV\n\ts0n3XC1h4oPEGQgYLmEvizaDATSD1cwyUJJkIAF3ZwEskOKWNyiqDQOuDUcAY7to\n\tz6aU6YjFe5laZn0BIU12sbvJjZWeNwnkDU1hc4K6Gs2C3PljD3L3qI=", "DKIM-Signature": "v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:from\n\t:subject:to:message-id:date:mime-version:content-type; s=\n\tdefault; bh=+O9/TkTSKfQuOMe6ZV0AYzHbcqU=; b=rsfgIS19+ZWxj7cJhugI\n\tENLGg7x9cj+jEZCkZmRFIVnNSUJC11v186L3rgfwINTIjB1cZFiqTdgoLAKifJI8\n\tJXEkrzsbgA0r7MWy+wj8ItmZIEERsx/1+Ivik1thrve1sxzCbrSndmlmSBAh0vbH\n\tdg1QXWiYWDTPqyg9E7AWOsE=", "Mailing-List": "contact gcc-patches-help@gcc.gnu.org; run by ezmlm", "Precedence": "bulk", "List-Id": "<gcc-patches.gcc.gnu.org>", "List-Unsubscribe": "<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>", "List-Archive": "<http://gcc.gnu.org/ml/gcc-patches/>", "List-Post": "<mailto:gcc-patches@gcc.gnu.org>", "List-Help": "<mailto:gcc-patches-help@gcc.gnu.org>", "Sender": "gcc-patches-owner@gcc.gnu.org", "X-Virus-Found": "No", "X-Spam-SWARE-Status": "No, score=-8.9 required=5.0 tests=AWL, BAYES_00,\n\tGIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS,\n\tKAM_LAZY_DOMAIN_SECURITY,\n\tRP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=36947,\n\tH*M:0efe, H*MI:0efe, 1.11", "X-Spam-User": "qpsmtpd, 2 recipients", "X-HELO": "mail.daswigwam.de", "From": "dbroemmel <dibr-bugzilla@daswigwam.de>", "Subject": "Patch for [Bug fortran/81841] [5/6/7/8 Regression] THREADPRIVATE\n\t(OpenMP) wrongly rejected in BLOCK DATA", "To": "fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org", "Message-ID": "<2f2d738f-90d7-0efe-1caf-7e3a6387b0eb@daswigwam.de>", "Date": "Fri, 1 Sep 2017 11:09:47 +0200", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64;\n\trv:52.0) Gecko/20100101 Thunderbird/52.2.1", "MIME-Version": "1.0", "Content-Type": "multipart/mixed;\n\tboundary=\"------------86443398B703DC58D8E42B8C\"" }, "content": "Hi all,\n\nattached are a proposed fix and new testcase for PR81841. The\nTHREADPRIVATE statement is currently wrongly rejected as part of BLOCK DATA.\n\nThe testcase also does (very basic) runtime checks. It fails (compiling)\nprior to the patch and completes after. Tested on x86_64 GNU/Linux.\n\nThanks,\nDirk\n\n\n2017-09-01 dbroemmel\n\n PR fortran/81841\n * parse.c (parse_spec): adding ST_OMP_THREADPRIVATE as allowed\n statement.\n\n2017-09-01 dbroemmel\n\n PR fortran/81841\n * gfortran.dg/gomp/omp_threadprivate3.f90: New testcase.", "diff": "Index: gcc/fortran/parse.c\n===================================================================\n--- gcc/fortran/parse.c\t(revision 251553)\n+++ gcc/fortran/parse.c\t(working copy)\n@@ -3694,6 +3694,7 @@\n \tcase ST_EQUIVALENCE:\n \tcase ST_IMPLICIT:\n \tcase ST_IMPLICIT_NONE:\n+\tcase ST_OMP_THREADPRIVATE:\n \tcase ST_PARAMETER:\n \tcase ST_STRUCTURE_DECL:\n \tcase ST_TYPE:\nIndex: gcc/testsuite/gfortran.dg/gomp/omp_threadprivate3.f90\n===================================================================\n--- gcc/testsuite/gfortran.dg/gomp/omp_threadprivate3.f90\t(revision 0)\n+++ gcc/testsuite/gfortran.dg/gomp/omp_threadprivate3.f90\t(working copy)\n@@ -0,0 +1,158 @@\n+! { dg-do run }\n+! { dg-options \"-fopenmp\" }\n+! PR fortran/81841\n+\n+\n+! Test OpenMP THREADPRIVATE statement together w/ BLOCK DATA for COMMON BLOCKs.\n+!\n+! We try to test for correct initialisation per thread of compile and runtime values.\n+! (The latter should be correctly defined on the master thread only, the former should\n+! be identical on all threads.)\n+! We also test behaviour in between two OpenMP PARALLEL regions.\n+! (Changed values only expected to be valid between the first overlapping threads.)\n+!\n+! This could be extended to allocatables and pointers, however, assuming\n+! THREADPRIVATE works in first place, this should test the BLOCK DATA case...\n+program block_data_threadprivate\n+ use omp_lib\n+ implicit none\n+\n+ integer :: int1, int2, int3 ! variables 1 and 2 end up in two common blocks\n+ real :: flt1, flt2, flt3 ! variables 3 should stay undefined\n+ ! (and are not necessary but included to\n+ ! check undefined values)\n+ common /c_block_1/ int1, flt1 ! to be initialised at runtime\n+ !$OMP THREADPRIVATE (/c_block_1/)\n+ common /c_block_2/ int2, flt2 ! to be initialised via BLOCK DATA\n+ !$OMP THREADPRIVATE (/c_block_2/)\n+\n+ ! runtime init int1 and flt1\n+ ! (should be defined on master thread only)\n+ int1 = 1\n+ flt1 = 1.1\n+ ! (int2 and flt2 should be available on all threads via BLOCK DATA and COMMON BLOCK)\n+ write(*,'(a27,1x,3(i5,1x,f5.2,1x))') 'main thread, variables are:', int1, flt1, int2, flt2, int3, flt3\n+ write(*,'(a27,1x,3(a5,1x,a5 ,1x))') 'they should be:', '1', '1.1', '2', '2.2', '???', '???'\n+\n+ ! spawn fixed number of threads to have predictable behaviour \n+ write(*,'(a)') 'spawning 4 threads'\n+ !$OMP PARALLEL default(none) private(int3, flt3) num_threads(4)\n+ !$OMP CRITICAL\n+ ! critical to get nicer, sorted output\n+ write(*,'(a22,1x,i3,a1,1x)',advance='no') 'thread id', omp_get_thread_num(), ':'\n+ write(*,'(3(i5,1x,f5.2,1x))') int1, flt1, int2, flt2, int3, flt3\n+ select case (omp_get_thread_num())\n+ case (0)\n+ write(*,'(a27,1x,3(a5,1x,a5 ,1x))') 'they should be:', '1', '1.1', '2', '2.2', '???', '???'\n+ if (int1 /= 1) call abort\n+ if (int2 /= 2) call abort\n+ if (flt1 >= 1.11 .or. flt1 <= 1.09) call abort\n+ if (flt2 >= 2.21 .or. flt2 <= 2.19) call abort\n+ case (1)\n+ write(*,'(a27,1x,3(a5,1x,a5 ,1x))') 'they should be:', '???', '???', '2', '2.2', '???', '???'\n+ if (int1 == 1) call abort\n+ if (int2 /= 2) call abort\n+ if (flt1 <= 1.11 .and. flt1 >= 1.09) call abort\n+ if (flt2 >= 2.21 .or. flt2 <= 2.19) call abort\n+ case (2)\n+ write(*,'(a27,1x,3(a5,1x,a5 ,1x))') 'they should be:', '???', '???', '2', '2.2', '???', '???'\n+ if (int1 == 1) call abort\n+ if (int2 /= 2) call abort\n+ if (flt1 <= 1.11 .and. flt1 >= 1.09) call abort\n+ if (flt2 >= 2.21 .or. flt2 <= 2.19) call abort\n+ case (3)\n+ write(*,'(a27,1x,3(a5,1x,a5 ,1x))') 'they should be:', '???', '???', '2', '2.2', '???', '???'\n+ if (int1 == 1) call abort\n+ if (int2 /= 2) call abort\n+ if (flt1 <= 1.11 .and. flt1 >= 1.09) call abort\n+ if (flt2 >= 2.21 .or. flt2 <= 2.19) call abort\n+ case default\n+ call abort\n+ end select\n+ !$OMP END CRITICAL\n+ !$OMP END PARALLEL\n+\n+ ! spawn fixed (but lower) number of threads and change private data\n+ write(*,'(a)') 'spawning 2 threads (changing thread private variables)'\n+ !$OMP PARALLEL default(none) private(int3, flt3) num_threads(2)\n+ int1 = 10 ! those are THREADPRIVATE variables, so should change\n+ flt1 = 10.1 ! on threads 1 and 2 only.\n+ int2 = 20\n+ flt2 = 20.2\n+ !$OMP END PARALLEL\n+\n+ ! spawn initial number of threads to test variables between parallel blocks\n+ write(*,'(a)') 'spawning 4 threads'\n+ !$OMP PARALLEL default(none) private(int3, flt3) num_threads(4)\n+ !$OMP CRITICAL\n+ write(*,'(a22,1x,i3,a1,1x)',advance='no') 'thread id', omp_get_thread_num(), ':'\n+ write(*,'(3(i5,1x,f5.2,1x))') int1, flt1, int2, flt2, int3, flt3\n+ select case (omp_get_thread_num())\n+ case (0)\n+ write(*,'(a27,1x,3(a5,1x,a5 ,1x))') 'they should be:', '10', '10.1', '20', '20.2', '???', '???'\n+ if (int1 /= 10) call abort\n+ if (int2 /= 20) call abort\n+ if (flt1 >= 10.11 .or. flt1 <= 10.09) call abort\n+ if (flt2 >= 20.21 .or. flt2 <= 20.19) call abort\n+ case (1)\n+ write(*,'(a27,1x,3(a5,1x,a5 ,1x))') 'they should be:', '10', '10.1', '20', '20.2', '???', '???'\n+ if (int1 /= 10) call abort\n+ if (int2 /= 20) call abort\n+ if (flt1 >= 10.11 .or. flt1 <= 10.09) call abort\n+ if (flt2 >= 20.21 .or. flt2 <= 20.19) call abort\n+ case (2)\n+ write(*,'(a27,1x,3(a5,1x,a5 ,1x))') 'they should be:', '???', '???', '2', '2.2', '???', '???'\n+ if (int1 == 1 .or. int1 == 10) call abort\n+ if (int2 /= 2) call abort\n+ if ((flt1 <= 1.11 .and. flt1 >= 1.09 ) .or. &\n+ (flt1 <= 10.11 .and. flt1 >= 10.09)) call abort\n+ if (flt2 >= 2.21 .or. flt2 <= 2.19) call abort\n+ case (3)\n+ write(*,'(a27,1x,3(a5,1x,a5 ,1x))') 'they should be:', '???', '???', '2', '2.2', '???', '???'\n+ if (int1 == 1 .or. int1 == 10) call abort\n+ if (int2 /= 2) call abort\n+ if ((flt1 <= 1.11 .and. flt1 >= 1.09 ) .or. &\n+ (flt1 <= 10.11 .and. flt1 >= 10.09)) call abort\n+ if (flt2 >= 2.21 .or. flt2 <= 2.19) call abort\n+ case default\n+ call abort\n+ end select\n+ !$OMP END CRITICAL\n+ !$OMP END PARALLEL\n+\n+ ! change variable on master thread\n+ int1 = 3\n+ flt1 = 3.3\n+ int2 = 4\n+ flt2 = 4.4\n+ write(*,'(a27,1x,3(i5,1x,f5.2,1x))') 'main thread, variables are:', int1, flt1, int2, flt2, int3, flt3\n+ write(*,'(a27,1x,3(a5,1x,a5 ,1x))') 'they should be:', '3', '3.3', '4', '4.4', '???', '???'\n+\n+ ! spawn initial number of threads, now using copyin assignment\n+ write(*,'(a)') 'spawning 4 threads (using copyin)'\n+ !$OMP PARALLEL default(none) private(int3, flt3) num_threads(4) copyin(/c_block_1/, /c_block_2/)\n+ !$OMP CRITICAL\n+ write(*,'(a22,1x,i3,a1,1x)',advance='no') 'thread id', omp_get_thread_num(), ':'\n+ write(*,'(3(i5,1x,f5.2,1x))') int1, flt1, int2, flt2, int3, flt3\n+ write(*,'(a27,1x,3(a5,1x,a5 ,1x))') 'they should be:', '3', '3.3', '4', '4.4', '???', '???'\n+ if (int1 /= 3) call abort\n+ if (int2 /= 4) call abort\n+ if (flt1 >= 3.31 .or. flt1 <= 3.29) call abort\n+ if (flt2 >= 4.41 .or. flt2 <= 4.29) call abort\n+ !$OMP END CRITICAL\n+ !$OMP END PARALLEL\n+\n+end program block_data_threadprivate\n+\n+! The DATA statement cannot be used for variables contained in a COMMON BLOCK,\n+! instead, BLOCK DATA has to be used to input data at compile time.\n+! When using OpenMP, THREADPRIVATE statements should be allowed and are required\n+! with every use of the COMMON BLOCK.\n+block data\n+ implicit none\n+ integer :: int2\n+ real :: flt2\n+ common /c_block_2/ int2, flt2\n+ !$OMP THREADPRIVATE(/c_block_2/)\n+ data int2, flt2 /2, 2.2/\n+end block data\n", "prefixes": [] }