Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/811399/?format=api
{ "id": 811399, "url": "http://patchwork.ozlabs.org/api/patches/811399/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20170908091316.GA85777@adacore.com/", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/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": "<20170908091316.GA85777@adacore.com>", "list_archive_url": null, "date": "2017-09-08T09:13:16", "name": "[Ada] Expand barrier conditions permitted by the restriction Pure_Barrier", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "52e418d4ebc4cc6c0ff58cf72b79622633be1563", "submitter": { "id": 4418, "url": "http://patchwork.ozlabs.org/api/people/4418/?format=api", "name": "Arnaud Charlet", "email": "charlet@adacore.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20170908091316.GA85777@adacore.com/mbox/", "series": [ { "id": 2144, "url": "http://patchwork.ozlabs.org/api/series/2144/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=2144", "date": "2017-09-08T09:13:16", "name": "[Ada] Expand barrier conditions permitted by the restriction Pure_Barrier", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/2144/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/811399/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/811399/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<gcc-patches-return-461704-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-461704-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=\"kqj1di5X\"; 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 3xpWp74Q3Xz9s82\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 8 Sep 2017 19:13:31 +1000 (AEST)", "(qmail 44039 invoked by alias); 8 Sep 2017 09:13:23 -0000", "(qmail 43769 invoked by uid 89); 8 Sep 2017 09:13:23 -0000", "from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by\n\tsourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tFri, 08 Sep 2017 09:13:17 +0000", "from localhost (localhost.localdomain [127.0.0.1])\tby\n\tfiltered-rock.gnat.com (Postfix) with ESMTP id 7D3465619D;\n\tFri, 8 Sep 2017 05:13:16 -0400 (EDT)", "from rock.gnat.com ([127.0.0.1])\tby localhost (rock.gnat.com\n\t[127.0.0.1]) (amavisd-new, port 10024)\twith LMTP id\n\tuGdv-LD5WkSs; Fri, 8 Sep 2017 05:13:16 -0400 (EDT)", "from tron.gnat.com (tron.gnat.com [205.232.38.10])\tby\n\trock.gnat.com (Postfix) with ESMTP id 6A8B556126;\n\tFri, 8 Sep 2017 05:13:16 -0400 (EDT)", "by tron.gnat.com (Postfix, from userid 4192)\tid 67478505;\n\tFri, 8 Sep 2017 05:13:16 -0400 (EDT)" ], "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:date\n\t:from:to:cc:subject:message-id:mime-version:content-type; q=dns;\n\ts=default; b=wAp3GgV93wsAF+0eeSj4qhV+tuoqfWQUduPUndmoJKggqjVUxr\n\t3j9g3FV/kd+NQL5q8RuaREPN9Rg5AiAm/Q57SwiiYtv9/IGJAUq4M41zOSR5HBo1\n\tkvSu1QJEmXSzT1H634Ypi6UqmDNHLY8gVTQnrS5k1fak2k5Vt29DNwk8A=", "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:date\n\t:from:to:cc:subject:message-id:mime-version:content-type; s=\n\tdefault; bh=wiLZPUuVAcdJgbOekuj+X3oiNw0=; b=kqj1di5X3Fv7w4RmyKr+\n\tOtTHzXi7hjdlacpn6Hs445CnGEdrVEcOUVapeTZoHDbhuJqhA9UyDR4FPVWk+jM3\n\tkdeGio7mpQXY6FVXIRcISaDC4B/m0l/Nv4EhHWPaOFcX/Jti847yQT7n/yOjZLna\n\tcojCW4u+9mDrpUBneOVujr4=", "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=-10.5 required=5.0 tests=AWL, BAYES_00,\n\tGIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS,\n\tRCVD_IN_DNSWL_NONE,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=foot", "X-HELO": "rock.gnat.com", "Date": "Fri, 8 Sep 2017 05:13:16 -0400", "From": "Arnaud Charlet <charlet@adacore.com>", "To": "gcc-patches@gcc.gnu.org", "Cc": "Patrick Bernardi <bernardi@adacore.com>", "Subject": "[Ada] Expand barrier conditions permitted by the restriction\n\tPure_Barrier", "Message-ID": "<20170908091316.GA85777@adacore.com>", "MIME-Version": "1.0", "Content-Type": "multipart/mixed; boundary=\"FL5UXtIhxfXey3p5\"", "Content-Disposition": "inline", "User-Agent": "Mutt/1.5.23 (2014-03-12)" }, "content": "This patch permits the use of type conversions and components of objects\nsubject to the following conditions: type conversions cannot potentially raise\ncontraint errors and access types cannot be dereferenced. These additions\nprovide greater functionality to users while respecting the aims of the\nPure_Barrier restriction: side effects, exceptions, and recursion cannot occur\nduring the evaluation of the barriers.\n\nIn practise this patch allows users to compare the result of the Count\nattribute with a literal or named number, and reference components of array or\nrecord types in barriers.\n\nThe following must compile quietly:\n\n---\npackage Test_PO is\n type BooT is record\n Far : Integer;\n end record;\n\n type FooT is record\n Bar : BooT;\n end record;\n\n protected PO is\n entry A;\n entry B;\n private\n Foo : FooT;\n end PO;\nend Test_PO;\n\n---\npragma Restrictions (Pure_Barriers);\n\npackage body Test_PO is\n protected body PO is\n entry A when A'Count > 5 is\n begin\n null;\n end A;\n\n entry B when Foo.Bar.Far = 5 is\n begin\n null;\n end B;\n end PO;\nend Test_PO;\n\nTested on x86_64-pc-linux-gnu, committed on trunk\n\n2017-09-08 Patrick Bernardi <bernardi@adacore.com>\n\n\t* exp_ch9.adb (Is_Pure_Barrier): Allow type\n\tconversions and components of objects. Simplified the detection\n\tof the Count attribute by identifying the corresponding run-time\n\tcalls.", "diff": "Index: exp_ch9.adb\n===================================================================\n--- exp_ch9.adb\t(revision 251863)\n+++ exp_ch9.adb\t(working copy)\n@@ -5999,8 +5999,9 @@\n Renamed : Node_Id;\n \n begin\n- -- Check for case of _object.all.field (note that the explicit\n- -- dereference gets inserted by analyze/expand of _object.field).\n+ -- Check if the name is a component of the protected object. If\n+ -- the expander is active, the component has been transformed into\n+ -- a renaming of _object.all.component.\n \n if Expander_Active then\n Renamed := Renamed_Object (Entity (N));\n@@ -6010,7 +6011,7 @@\n and then Nkind (Renamed) = N_Selected_Component\n and then Chars (Prefix (Prefix (Renamed))) = Name_uObject;\n else\n- return Scope (Entity (N)) = Current_Scope;\n+ return Is_Protected_Component (Entity (N));\n end if;\n end Is_Simple_Barrier_Name;\n \n@@ -6019,25 +6020,6 @@\n ---------------------\n \n function Is_Pure_Barrier (N : Node_Id) return Traverse_Result is\n- function Is_Count_Attribute (N : Node_Id) return Boolean;\n- -- Check whether N is part of an expansion of the Count attribute.\n- -- Return True if N represents the expanded function call.\n-\n- ------------------------\n- -- Is_Count_Attribute --\n- ------------------------\n-\n- function Is_Count_Attribute (N : Node_Id) return Boolean is\n- begin\n- return\n- Nkind (N) = N_Function_Call\n- and then Present (Original_Node (N))\n- and then Nkind (Original_Node (N)) = N_Attribute_Reference\n- and then Attribute_Name (Original_Node (N)) = Name_Count;\n- end Is_Count_Attribute;\n-\n- -- Start of processing for Is_Pure_Barrier\n-\n begin\n case Nkind (N) is\n when N_Expanded_Name\n@@ -6045,11 +6027,8 @@\n =>\n if No (Entity (N)) then\n return Abandon;\n- end if;\n \n- if Present (Parent (N))\n- and then Is_Count_Attribute (Parent (N))\n- then\n+ elsif Is_Universal_Numeric_Type (Entity (N)) then\n return OK;\n end if;\n \n@@ -6062,25 +6041,36 @@\n =>\n return OK;\n \n- when E_Component\n- | E_Variable\n- =>\n- -- A variable in the protected type is expanded as a\n- -- component.\n+ when E_Component =>\n+ return OK;\n \n+ when E_Variable =>\n if Is_Simple_Barrier_Name (N) then\n return OK;\n end if;\n \n+ when E_Function =>\n+\n+ -- The count attribute has been transformed into run-time\n+ -- calls.\n+\n+ if Is_RTE (Entity (N), RE_Protected_Count)\n+ or else Is_RTE (Entity (N), RE_Protected_Count_Entry)\n+ then\n+ return OK;\n+ end if;\n+\n when others =>\n null;\n end case;\n \n when N_Function_Call =>\n- if Is_Count_Attribute (N) then\n- return OK;\n- end if;\n \n+ -- Function call checks are carried out as part of the analysis\n+ -- of the function call name.\n+\n+ return OK;\n+\n when N_Character_Literal\n | N_Integer_Literal\n | N_Real_Literal\n@@ -6097,6 +6087,27 @@\n when N_Short_Circuit =>\n return OK;\n \n+ when N_Indexed_Component\n+ | N_Selected_Component\n+ =>\n+ if not Is_Access_Type (Etype (Prefix (N))) then\n+ return OK;\n+ end if;\n+\n+ when N_Type_Conversion =>\n+\n+ -- Conversions to Universal_Integer will not raise constraint\n+ -- errors.\n+\n+ if Cannot_Raise_Constraint_Error (N)\n+ or else Etype (N) = Universal_Integer\n+ then\n+ return OK;\n+ end if;\n+\n+ when N_Unchecked_Type_Conversion =>\n+ return OK;\n+\n when others =>\n null;\n end case;\n", "prefixes": [ "Ada" ] }