gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)
 ./configure --prefix=/home/common/openmpi/build/svn-trunk --enable-mpi-java 
--enable-orterun-prefix-by-default

More inline below

On May 27, 2014, at 9:29 PM, Gilles Gouaillardet 
<gilles.gouaillar...@gmail.com> wrote:

> Ralph,
> 
> can you please describe your environment (at least compiler (and version) + 
> configure command line)
> i checked osc_rdma_data_move.c only :
> 
> size_t incoming_length; is used to improve readability.
> it is used only in an assert clause and in OPAL_OUTPUT_VERBOSE
> 
> one way to silence the warning is not to use this variable (and compromise 
> readability).
> 
> an other way would be to
> #if OPAL_ENABLE_DEBUG
> size_t incoming_length = request->req_status._ucount);
> #endif
> 
> imho, a more elegant way would be to use a macro like
> OPAL_IF_DEBUG(size_t incoming_length = request->req_status._ucount);)
> 
> /* i am not aware of such a macro, please point me if it already exists */
> 
> any thoughts ?

I'm unaware of such a macro, but could see the value in creating one - though I 
must admit, this problem hasn't come up very often. Your choice - either way 
(surround it with #if or create a macro) is fine with me.

> 
> 
> about the other warnings, xxx may be used uninitialized in this function, i 
> was unable to reproduce it and i have to double check again.
> so far, it seems this is a false positive/compiler bug that could be 
> triggered by inlining
> /* i could not find any path in which the variable is used unitialized */

I just glanced at the first one (line 221 of osc_rdma_data_move.c), and I can 
see what the compiler is complaining about - have gotten this in other places 
as well. The problem is that you pass the address of ptr into a function 
without first initializing the value of ptr itself. There is no guarantee (so 
far as the compiler can see) that this function will in fact set the value of 
ptr - you are relying solely on the fact that (a) you checked that function at 
one point in time and saw that it always gets set to something if ret == 
OMPI_SUCCESS, and (b) nobody changed that function since you checked.

Newer compilers seem to be getting more defensive about such things and 
starting to "bark" when they see it. I think you are correct that inlining also 
impacts that situation, though I've also been seeing it when the functions 
aren't inlined.

Not sure what to suggest here - hate to add initialization steps in that 
sequence....

> 
> Cheers,
> 
> Gilles
> 
> 
> On Mon, May 26, 2014 at 12:25 PM, Ralph Castain <r...@open-mpi.org> wrote:
> Building optimized on an IB-based machine:
> 
> osc_rdma_data_move.c: In function 'ompi_osc_rdma_callback':
> osc_rdma_data_move.c:1633: warning: unused variable 'incoming_length'
> osc_rdma_data_move.c: In function 'ompi_osc_rdma_control_send':
> osc_rdma_data_move.c:221: warning: 'ptr' may be used uninitialized in this 
> function
> osc_rdma_data_move.c:220: warning: 'frag' may be used uninitialized in this 
> function
> osc_rdma_data_move.c: In function 'ompi_osc_gacc_long_start':
> osc_rdma_data_move.c:961: warning: 'acc_data' may be used uninitialized in 
> this function
> osc_rdma_data_move.c: In function 'ompi_osc_rdma_gacc_start':
> osc_rdma_data_move.c:912: warning: 'acc_data' may be used uninitialized in 
> this function
> osc_rdma_comm.c: In function 'ompi_osc_rdma_rget_accumulate_internal':
> osc_rdma_comm.c:943: warning: 'ptr' may be used uninitialized in this function
> osc_rdma_comm.c:940: warning: 'frag' may be used uninitialized in this 
> function
> osc_rdma_data_move.c: In function 'ompi_osc_rdma_acc_long_start':
> osc_rdma_data_move.c:827: warning: 'acc_data' may be used uninitialized in 
> this function
> osc_rdma_comm.c: In function 'ompi_osc_rdma_rget':
> osc_rdma_comm.c:736: warning: 'ptr' may be used uninitialized in this function
> osc_rdma_comm.c:733: warning: 'frag' may be used uninitialized in this 
> function
> osc_rdma_comm.c: In function 'ompi_osc_rdma_accumulate_w_req':
> osc_rdma_comm.c:420: warning: 'ptr' may be used uninitialized in this function
> osc_rdma_comm.c:417: warning: 'frag' may be used uninitialized in this 
> function
> osc_rdma_comm.c: In function 'ompi_osc_rdma_put_w_req':
> osc_rdma_comm.c:251: warning: 'ptr' may be used uninitialized in this function
> osc_rdma_comm.c:244: warning: 'frag' may be used uninitialized in this 
> function
> osc_rdma_comm.c: In function 'ompi_osc_rdma_get':
> osc_rdma_comm.c:736: warning: 'ptr' may be used uninitialized in this function
> osc_rdma_comm.c:733: warning: 'frag' may be used uninitialized in this 
> function
> 
> 
> 
> 
> vt_plugin_cntr.c: In function 'vt_plugin_cntr_write_post_mortem':
> vt_plugin_cntr.c:1139: warning: 'min_counter' may be used uninitialized in 
> this function
> vt_plugin_cntr.c: In function 'vt_plugin_cntr_write_post_mortem':
> vt_plugin_cntr.c:1139: warning: 'min_counter' may be used uninitialized in 
> this function
> vt_plugin_cntr.c: In function 'vt_plugin_cntr_write_post_mortem':
> vt_plugin_cntr.c:1139: warning: 'min_counter' may be used uninitialized in 
> this function
> vt_plugin_cntr.c: In function 'vt_plugin_cntr_write_post_mortem':
> vt_plugin_cntr.c:1139: warning: 'min_counter' may be used uninitialized in 
> this function
> 
> 
> _______________________________________________
> devel mailing list
> de...@open-mpi.org
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
> Link to this post: 
> http://www.open-mpi.org/community/lists/devel/2014/05/14840.php
> 
> _______________________________________________
> devel mailing list
> de...@open-mpi.org
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
> Link to this post: 
> http://www.open-mpi.org/community/lists/devel/2014/05/14880.php

Reply via email to