public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "joseph at codesourcery dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sources.redhat.com
Subject: [Bug libc/10114] silence warning in soft-fp
Date: Fri, 08 May 2009 11:04:00 -0000	[thread overview]
Message-ID: <20090508110442.13301.qmail@sourceware.org> (raw)
In-Reply-To: <20090429155550.10114.rsa@us.ibm.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1699 bytes --]


------- 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.


  parent reply	other threads:[~2009-05-08 11:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-29 15:56 [Bug libc/10114] New: " rsa at us dot ibm dot com
2009-04-29 15:57 ` [Bug libc/10114] " rsa at us dot ibm dot com
2009-04-29 17:32 ` rsa at us dot ibm dot com
2009-05-08  5:57 ` bje at sources dot redhat dot com
2009-05-08 11:04 ` joseph at codesourcery dot com [this message]
2009-05-08 21:06 ` bje at sources dot redhat dot com
2009-05-11  7:08 ` bje at sources dot redhat dot com
2009-05-22  3:23 ` bje at sources dot redhat dot com
2009-05-22  5:09 ` rsa at us dot ibm dot com
2009-06-09  4:19 ` bje at sources dot redhat dot com
2009-06-09  6:02 ` jakub at redhat dot com
     [not found] <bug-10114-131@http.sourceware.org/bugzilla/>
2011-03-16 21:33 ` roland at gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090508110442.13301.qmail@sourceware.org \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).