Skip to content

Commit 7814f41

Browse files
authored
Merge pull request #7845 from devreal/stack-fixes
Fix unexpected optimizations detected by STACK
2 parents 910a030 + d9d18ac commit 7814f41

File tree

4 files changed

+8
-15
lines changed

4 files changed

+8
-15
lines changed

ompi/mca/hook/comm_method/hook_comm_method_fns.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,8 +789,7 @@ ompi_report_comm_methods(int called_from_location) // 1 = from init, 2 = from fi
789789
if (majority_method_offhost == -1) {
790790
majority_method_offhost = this_method;
791791
}
792-
if (majority_method_offhost != -1 &&
793-
this_method != majority_method_offhost)
792+
if (this_method != majority_method_offhost)
794793
{
795794
uniformity_offhost = 0;
796795
}

ompi/mca/osc/rdma/osc_rdma_accumulate.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,8 @@ static inline int ompi_osc_rdma_gacc_contig (ompi_osc_rdma_sync_t *sync, const v
241241
return ompi_osc_rdma_put_contig (sync, peer, target_address, target_handle, ptr, len, request);
242242
}
243243

244-
if (request) {
245-
/* nothing more to do for this request */
246-
ompi_osc_rdma_request_complete (request, MPI_SUCCESS);
247-
}
244+
/* nothing more to do for this request */
245+
ompi_osc_rdma_request_complete (request, MPI_SUCCESS);
248246

249247
return OMPI_SUCCESS;
250248
}

ompi/mca/osc/ucx/osc_ucx_component.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -538,21 +538,16 @@ static int component_select(struct ompi_win_t *win, void **base, size_t size, in
538538
error:
539539
if (module->disp_units) free(module->disp_units);
540540
if (module->comm) ompi_comm_free(&module->comm);
541-
/* We update the modules count and (if need) registering a callback right
542-
* prior to memory allocation for the module.
543-
* So we use it as an indirect sign here
544-
*/
545-
if (module) {
546-
free(module);
547-
ompi_osc_ucx_unregister_progress();
548-
}
541+
free(module);
549542

550543
error_nomem:
551544
if (env_initialized == true) {
552545
opal_common_ucx_wpool_finalize(mca_osc_ucx_component.wpool);
553546
OBJ_DESTRUCT(&mca_osc_ucx_component.requests);
554547
mca_osc_ucx_component.env_initialized = false;
555548
}
549+
550+
ompi_osc_ucx_unregister_progress();
556551
return ret;
557552
}
558553

ompi/mca/topo/treematch/treematch/tm_malloc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,13 @@ void *tm_realloc(void *old_ptr, size_t size, char *file, int line){
210210
}
211211

212212
void tm_free(void *ptr){
213-
byte *original_ptr = ((byte *)ptr) - EXTRA_BYTE;
213+
byte *original_ptr;
214214
size_t size;
215215

216216
if(!ptr)
217217
return;
218218

219+
original_ptr = ((byte *)ptr) - EXTRA_BYTE;
219220
size = retreive_size(original_ptr);
220221

221222
if((bcmp(original_ptr ,extra_data, EXTRA_BYTE)) && ((tm_get_verbose_level()>=ERROR))){

0 commit comments

Comments
 (0)