public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/omp/gcc-11] Fortran: set version field in CFI_cdesc_t to CFI_VERSION
@ 2021-07-27  9:50 Tobias Burnus
  0 siblings, 0 replies; only message in thread
From: Tobias Burnus @ 2021-07-27  9:50 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:36c21293f3b4635a3a15ac365db71d2f05b356d3

commit 36c21293f3b4635a3a15ac365db71d2f05b356d3
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Tue Jul 27 11:37:11 2021 +0200

    Fortran: set version field in CFI_cdesc_t to CFI_VERSION
    
    When converting a GFC descriptor to a CFI descriptor, it was
    incorrectly copying the version number from the former to the latter.
    It should be using the value of CFI_VERSION instead (currently 1).
    Going the other direction, the GFC version field is initialized to
    zero elsewhere, so do that here too.
    
    2021-06-30  Tobias Burnus  <tobias@codesourcery.com>
                Sandra Loosemore  <sandra@codesourcery.com>
    
            libgfortran/
            * runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc):
            Initialize version field to 0.
            (gfc_desc_to_cfi_desc): Initialize version field to CFI_VERSION.
    
    (cherry picked from commit 58b735b70b03884052c80ac032df90eed7059f8d)

Diff:
---
 libgfortran/ChangeLog.omp                 | 9 +++++++++
 libgfortran/runtime/ISO_Fortran_binding.c | 4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/libgfortran/ChangeLog.omp b/libgfortran/ChangeLog.omp
new file mode 100644
index 00000000000..b8b9e9ce2a3
--- /dev/null
+++ b/libgfortran/ChangeLog.omp
@@ -0,0 +1,9 @@
+2021-07-27  Tobias Burnus  <tobias@codesourcery.com>
+
+	Backported from master:
+	2021-06-30  Tobias Burnus  <tobias@codesourcery.com>
+		    Sandra Loosemore  <sandra@codesourcery.com>
+
+	* runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc):
+	Initialize version field to 0.
+	(gfc_desc_to_cfi_desc): Initialize version field to CFI_VERSION.
diff --git a/libgfortran/runtime/ISO_Fortran_binding.c b/libgfortran/runtime/ISO_Fortran_binding.c
index 09788321c9e..73fb4c4e729 100644
--- a/libgfortran/runtime/ISO_Fortran_binding.c
+++ b/libgfortran/runtime/ISO_Fortran_binding.c
@@ -60,7 +60,7 @@ cfi_desc_to_gfc_desc (gfc_array_void *d, CFI_cdesc_t **s_ptr)
   else
     GFC_DESCRIPTOR_SIZE (d) = s->elem_len;
 
-  d->dtype.version = s->version;
+  d->dtype.version = 0;
   GFC_DESCRIPTOR_RANK (d) = (signed char)s->rank;
 
   d->dtype.attribute = (signed short)s->attribute;
@@ -104,7 +104,7 @@ gfc_desc_to_cfi_desc (CFI_cdesc_t **d_ptr, const gfc_array_void *s)
 
   d->base_addr = GFC_DESCRIPTOR_DATA (s);
   d->elem_len = GFC_DESCRIPTOR_SIZE (s);
-  d->version = s->dtype.version;
+  d->version = CFI_VERSION;
   d->rank = (CFI_rank_t)GFC_DESCRIPTOR_RANK (s);
   d->attribute = (CFI_attribute_t)s->dtype.attribute;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-27  9:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-27  9:50 [gcc/devel/omp/gcc-11] Fortran: set version field in CFI_cdesc_t to CFI_VERSION Tobias Burnus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).