[patch] OpenMP: Fortran - support omp flush's memorder clauses

Bernhard Reutner-Fischer rep.dot.nop@gmail.com
Fri Oct 23 09:40:51 GMT 2020


On 22 October 2020 17:02:36 CEST, Jakub Jelinek via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>On Thu, Oct 22, 2020 at 04:52:10PM +0200, Tobias Burnus wrote:
>> +  else
>> +    {
>> +      enum memmodel mo = MEMMODEL_LAST;
>> +      switch (code->ext.omp_clauses->memorder)
>> +	{
>> +	case OMP_MEMORDER_ACQ_REL: mo = MEMMODEL_ACQ_REL; break;
>> +	case OMP_MEMORDER_RELEASE: mo = MEMMODEL_RELEASE; break;
>> +	case OMP_MEMORDER_ACQUIRE: mo = MEMMODEL_ACQUIRE; break;
>> +	case OMP_MEMORDER_LAST: gcc_unreachable (); break;
>
>I'd probably use
>	default: gcc_unreachable (); break;
>here instead.
>Otherwise LGTM, thanks.

I have one trivial remark though. In

+    {
+      if (gfc_match ("acq_rel") == MATCH_YES)
+	mo = OMP_MEMORDER_ACQ_REL;
+      else if (gfc_match ("release") == MATCH_YES)
+	mo = OMP_MEMORDER_RELEASE;
+      else if (gfc_match ("acquire") == MATCH_YES)
+	mo = OMP_MEMORDER_ACQUIRE;
+      else
+	{
+	  gfc_error ("Expected AQC_REL, RELEASE, or ACQUIRE at %C");

I suggest s/AQC/ACQ/
LGTM too, otherwise ;)


More information about the Gcc-patches mailing list