From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13359 invoked by alias); 8 May 2009 11:04:54 -0000 Received: (qmail 13302 invoked by alias); 8 May 2009 11:04:42 -0000 Date: Fri, 08 May 2009 11:04:00 -0000 Message-ID: <20090508110442.13301.qmail@sourceware.org> From: "joseph at codesourcery dot com" To: glibc-bugs@sources.redhat.com In-Reply-To: <20090429155550.10114.rsa@us.ibm.com> References: <20090429155550.10114.rsa@us.ibm.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug libc/10114] silence warning in soft-fp X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2009-05/txt/msg00039.txt.bz2 ------- 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.