public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/10114] New: silence warning in soft-fp
@ 2009-04-29 15:56 rsa at us dot ibm dot com
  2009-04-29 15:57 ` [Bug libc/10114] " rsa at us dot ibm dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: rsa at us dot ibm dot com @ 2009-04-29 15:56 UTC (permalink / raw)
  To: glibc-bugs

The following patch silences a warning when building soft-fp, due to the _e field
being uninitialised in some instances.

-- 
           Summary: silence warning in soft-fp
           Product: glibc
           Version: 2.10
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: rsa at us dot ibm dot com
                CC: glibc-bugs at sources dot redhat dot com


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.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libc/10114] silence warning in soft-fp
  2009-04-29 15:56 [Bug libc/10114] New: silence warning in soft-fp rsa at us dot ibm dot com
@ 2009-04-29 15:57 ` rsa at us dot ibm dot com
  2009-04-29 17:32 ` rsa at us dot ibm dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rsa at us dot ibm dot com @ 2009-04-29 15:57 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From rsa at us dot ibm dot com  2009-04-29 15:57 -------
Created an attachment (id=3917)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=3917&action=view)
soft-fp op-common.h patch


-- 


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.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libc/10114] silence warning in soft-fp
  2009-04-29 15:56 [Bug libc/10114] New: silence warning in soft-fp 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
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rsa at us dot ibm dot com @ 2009-04-29 17:32 UTC (permalink / raw)
  To: glibc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |2.10
            Version|2.10                        |2.9


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.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libc/10114] silence warning in soft-fp
  2009-04-29 15:56 [Bug libc/10114] New: silence warning in soft-fp 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
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bje at sources dot redhat dot com @ 2009-05-08  5:57 UTC (permalink / raw)
  To: glibc-bugs

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


------- Additional Comments From bje at sources dot redhat dot com  2009-05-08 05:57 -------
I took a closer look at this during the week.  Here is an example of the code
that produces the warning (from divsf3.c):

SFtype __divsf3(SFtype a, SFtype b)
{
  FP_DECL_EX;
  FP_DECL_S(A); FP_DECL_S(B); FP_DECL_S(R);
  SFtype r;

  FP_INIT_ROUNDMODE;
  FP_UNPACK_S(A, a);
  FP_UNPACK_S(B, b);
  FP_DIV_S(R, A, B);
  FP_PACK_S(r, R);
  FP_HANDLE_EXCEPTIONS;

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

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |roland at redhat dot com


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.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libc/10114] silence warning in soft-fp
  2009-04-29 15:56 [Bug libc/10114] New: silence warning in soft-fp rsa at us dot ibm dot com
                   ` (2 preceding siblings ...)
  2009-05-08  5:57 ` bje at sources dot redhat dot com
@ 2009-05-08 11:04 ` joseph at codesourcery dot com
  2009-05-08 21:06 ` bje at sources dot redhat dot com
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: joseph at codesourcery dot com @ 2009-05-08 11:04 UTC (permalink / raw)
  To: glibc-bugs

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libc/10114] silence warning in soft-fp
  2009-04-29 15:56 [Bug libc/10114] New: silence warning in soft-fp rsa at us dot ibm dot com
                   ` (3 preceding siblings ...)
  2009-05-08 11:04 ` joseph at codesourcery dot com
@ 2009-05-08 21:06 ` bje at sources dot redhat dot com
  2009-05-11  7:08 ` bje at sources dot redhat dot com
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bje at sources dot redhat dot com @ 2009-05-08 21:06 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From bje at sources dot redhat dot com  2009-05-08 21:06 -------
Thanks, Joseph.  I looked at the code for a while, but could not convince myself
as you have :-)  I'll propose a patch using X=X instead.

-- 


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.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libc/10114] silence warning in soft-fp
  2009-04-29 15:56 [Bug libc/10114] New: silence warning in soft-fp rsa at us dot ibm dot com
                   ` (4 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bje at sources dot redhat dot com @ 2009-05-11  7:08 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From bje at sources dot redhat dot com  2009-05-11 07:07 -------
I will post this patch:

@@ -31,7 +31,7 @@
    MA 02110-1301, USA.  */
 
 #define _FP_DECL(wc, X)                                                \
-  _FP_I_TYPE X##_c __attribute__((unused)), X##_s, X##_e;      \
+  _FP_I_TYPE X##_c __attribute__((unused)), X##_s, X##_e = X##_e;      \
   _FP_FRAC_DECL_##wc(X)
 
 /*


-- 


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.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libc/10114] silence warning in soft-fp
  2009-04-29 15:56 [Bug libc/10114] New: silence warning in soft-fp rsa at us dot ibm dot com
                   ` (5 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bje at sources dot redhat dot com @ 2009-05-22  3:23 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From bje at sources dot redhat dot com  2009-05-22 03:23 -------
Created an attachment (id=3956)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=3956&action=view)
Revised patch.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
Attachment #3917 is|0                           |1
           obsolete|                            |


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.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libc/10114] silence warning in soft-fp
  2009-04-29 15:56 [Bug libc/10114] New: silence warning in soft-fp rsa at us dot ibm dot com
                   ` (6 preceding siblings ...)
  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
  9 siblings, 0 replies; 11+ messages in thread
From: rsa at us dot ibm dot com @ 2009-05-22  5:09 UTC (permalink / raw)
  To: glibc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at redhat dot com


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.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libc/10114] silence warning in soft-fp
  2009-04-29 15:56 [Bug libc/10114] New: silence warning in soft-fp rsa at us dot ibm dot com
                   ` (7 preceding siblings ...)
  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
  9 siblings, 0 replies; 11+ messages in thread
From: bje at sources dot redhat dot com @ 2009-06-09  4:19 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From bje at sources dot redhat dot com  2009-06-09 04:19 -------
Is there any interest in eliminating this warning?

-- 


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.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libc/10114] silence warning in soft-fp
  2009-04-29 15:56 [Bug libc/10114] New: silence warning in soft-fp rsa at us dot ibm dot com
                   ` (8 preceding siblings ...)
  2009-06-09  4:19 ` bje at sources dot redhat dot com
@ 2009-06-09  6:02 ` jakub at redhat dot com
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at redhat dot com @ 2009-06-09  6:02 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From jakub at redhat dot com  2009-06-09 06:02 -------
The proposed patch is bad, it will inhibit warnings even for the non-canonical
paths.  I guess asm ("" : "=rm" (X##_e)) hidden in some macro put into the
problematic macros would be much better, assuming it doesn't penalize generated
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.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-06-09  6:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-29 15:56 [Bug libc/10114] New: silence warning in soft-fp 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
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

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