From 185a4599951aa854ce7f2628fce4d138ff27f596 Mon Sep 17 00:00:00 2001 From: Joshua Hursey Date: Wed, 30 Dec 2020 11:37:39 -0600 Subject: [PATCH] Fix PGI compiler error with compare arg * PGI was throwing the following error. ``` NVC++-S-0103-Illegal operand types for comparison operator (osc_rdma_frag.h: 75) NVC++/power Linux 20.11-0: compilation completed with severe errors ``` * It must not have liked the inline declaration of the NULL pointer. - So replace with a variable, as we do in other places in the code base. Signed-off-by: Joshua Hursey --- ompi/mca/osc/rdma/osc_rdma_frag.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ompi/mca/osc/rdma/osc_rdma_frag.h b/ompi/mca/osc/rdma/osc_rdma_frag.h index f174f48e7f..fb271840fc 100644 --- a/ompi/mca/osc/rdma/osc_rdma_frag.h +++ b/ompi/mca/osc/rdma/osc_rdma_frag.h @@ -3,6 +3,7 @@ * Copyright (c) 2012 Sandia National Laboratories. All rights reserved. * Copyright (c) 2014-2018 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2020 IBM Corporation. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -50,6 +51,7 @@ static inline int ompi_osc_rdma_frag_alloc (ompi_osc_rdma_module_t *module, size if (NULL == curr) { opal_free_list_item_t *item = NULL; + void *_tmp_ptr = NULL; item = opal_free_list_get (&mca_osc_rdma_component.frags); if (OPAL_UNLIKELY(NULL == item)) { @@ -72,7 +74,7 @@ static inline int ompi_osc_rdma_frag_alloc (ompi_osc_rdma_module_t *module, size } } - if (!opal_atomic_compare_exchange_strong_ptr ((opal_atomic_intptr_t *) &module->rdma_frag, &(intptr_t){0}, (intptr_t) curr)) { + if (!opal_atomic_compare_exchange_strong_ptr ((opal_atomic_intptr_t *) &module->rdma_frag, (intptr_t *) &_tmp_ptr, (intptr_t) curr)) { ompi_osc_rdma_deregister (module, curr->handle); curr->handle = NULL;