diff mbox

[soft-fp] : Possibly use of uninitialized variables

Message ID AANLkTim_J3RgwO2ixQQ=XkPuwNsJr64aRHC2ruEHcM0v@mail.gmail.com
State New
Headers show

Commit Message

Kai Tietz Oct. 18, 2010, 11:14 a.m. UTC
Hello,

This fixes some potential uses of unitialized variables, which I got
reported by gcc 3.4.4 while bootstrap and it seems right by its
detection.

ChangeLog

2010-10-18  Kai Tietz

        * config/soft-fp/op-common.h (_FP_DECL): Initialize
        variable by zero.

Tested for x86_64-w64-mingw32, and i686-pc-mingw32. Ok for apply?

Regards,
Kai

Comments

Joseph Myers Oct. 18, 2010, 11:50 a.m. UTC | #1
On Mon, 18 Oct 2010, Kai Tietz wrote:

> Hello,
> 
> This fixes some potential uses of unitialized variables, which I got
> reported by gcc 3.4.4 while bootstrap and it seems right by its
> detection.

Please see codingconventions.html.  soft-fp patches must always go in 
glibc first with unmodified glibc code then being imported into GCC.

In this case, see <http://sourceware.org/bugzilla/show_bug.cgi?id=10114> - 
you'll need to work out a fix on the lines of what the last comment 
indicates.

This code should never be built with 3.4.4 anyway; it's target code that 
should only be built by the newly built compiler.
Kai Tietz Oct. 18, 2010, 12:46 p.m. UTC | #2
gcc-patches-owner@gcc.gnu.org wrote on 18.10.2010 13:50:43:

> On Mon, 18 Oct 2010, Kai Tietz wrote:
> 
> > Hello,
> > 
> > This fixes some potential uses of unitialized variables, which I got
> > reported by gcc 3.4.4 while bootstrap and it seems right by its
> > detection.
> 
> Please see codingconventions.html.  soft-fp patches must always go in 
> glibc first with unmodified glibc code then being imported into GCC.
> 
> In this case, see <http://sourceware.org/bugzilla/show_bug.cgi?id=10114> 
- 
> you'll need to work out a fix on the lines of what the last comment 
> indicates.

Well, I see that this problem is already addressed for a year.  I have to 
admit that soft-fp build for targets, which aren't based on glibc, is a 
bit loud due unprototyped functions and some potential uninitialized 
variables, but all in all nothing serious.  So I am patient that this 
latent issues get fixed on glibc.

> This code should never be built with 3.4.4 anyway; it's target code that 

> should only be built by the newly built compiler.

Yes, sorry for being unclear here. Of course warning is shown by produced 
4.6 based compiler.


> -- 
> Joseph S. Myers
> joseph@codesourcery.com
> 

Regards,
Kai
diff mbox

Patch

Index: op-common.h
===================================================================
--- op-common.h (revision 165609)
+++ op-common.h (working copy)
@@ -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 = 0, X##_e = 0;      \
   _FP_FRAC_DECL_##wc(X)

 /*