This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/10114] silence warning in soft-fp


------- Additional Comments From joseph at codesourcery dot com  2009-05-08 11:04 -------
Subject: Re:  silence warning in soft-fp

On Fri, 8 May 2009, bje at sources dot redhat dot com wrote:

>   FP_DIV_S(R, A, B);
>   FP_PACK_S(r, R);

> Compiling this file produces:
>   warning: ?R_e? may be used uninitialized in this function
> 
> I have preprocessed the source file and looked very closely at how the warning
> is produced -- it is triggered by FP_PACK_S -> _FP_PACK_CANONICAL.
> 
> The data flow is quite complex and I cannot convince myself that the line X##_e
> += _FP_EXPBIAS_##fs from _FP_PACK_CANONICAL always operates on an initialised
> X##_e variable.  GCC seems to agree with me.  I fear there is a bug here,
> whereby R_e is being incremented on an uninitialised variable.

I don't think there is a bug.  Each case in _FP_DIV sets R##_c.  The code 
you refer to in _FP_PACK_CANONICAL only applies if R##_c ends up as 
FP_CLS_NORMAL.  That only applies in the 
_FP_CLS_COMBINE(FP_CLS_NORMAL,FP_CLS_NORMAL) case in _FP_DIV, which sets 
R##_e.  Every other case sets R##_c either explicitly or from the class of 
one of the operands (or using _FP_CHOOSENAN which should also set it), and 
when set from one of the operands it is FP_CLS_NAN.  I'd suppose that the 
compiler does not try to keep track of the exact set of possible values 
and so gives this warning.

Instead of initializing to 0, using "X##_e = X##_e" would silence the 
warning without generating additional initialization code.



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10114

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]