This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

RFA [3.4]: fix valgrind failures



These patches have already been accepted for mainline:
http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01825.html
http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01827.html
http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01828.html

bootstrapped, compared and regtested in gcc-3_4-branch sources 
from today on i686-pc-linux-gnu native without new regressions.
sh-elf regtest is under way.

2005-01-21  J"orn Rennecke <joern.rennecke@st.com>

gcc:
	* real.c (do_add): Initialize signalling and canonical members.

	* real.c (real_from_integer): Zero out destination.

gcc/cp:
	PR c++/18370
	* parser.c (cp_parser_initializer_clause): Initialize *non_constant_p.

diff -pu /view/renneckej-int-gcc-3.4.3/vob/sh5gcc.cmp/src/gcc/real.c ./real.c
--- /view/renneckej-int-gcc-3.4.3/vob/sh5gcc.cmp/src/gcc/real.c	2005-01-21 16:08:22.000000000 +0000
+++ ./real.c	2005-01-21 19:28:52.000000000 +0000
@@ -640,6 +640,9 @@ do_add (REAL_VALUE_TYPE *r, const REAL_V
   r->class = rvc_normal;
   r->sign = sign;
   r->exp = exp;
+  /* Zero out the remaining fields.  */
+  r->signalling = 0;
+  r->canonical = 0;
 
   /* Re-normalize the result.  */
   normalize (r);
@@ -1960,6 +1963,7 @@ real_from_integer (REAL_VALUE_TYPE *r, e
     get_zero (r, 0);
   else
     {
+      memset (r, 0, sizeof (*r));
       r->class = rvc_normal;
       r->sign = high < 0 && !unsigned_p;
       r->exp = 2 * HOST_BITS_PER_WIDE_INT;
@@ -1977,7 +1981,6 @@ real_from_integer (REAL_VALUE_TYPE *r, e
 	{
 	  r->sig[SIGSZ-1] = high;
 	  r->sig[SIGSZ-2] = low;
-	  memset (r->sig, 0, sizeof(long)*(SIGSZ-2));
 	}
       else if (HOST_BITS_PER_LONG*2 == HOST_BITS_PER_WIDE_INT)
 	{
@@ -1985,8 +1988,6 @@ real_from_integer (REAL_VALUE_TYPE *r, e
 	  r->sig[SIGSZ-2] = high;
 	  r->sig[SIGSZ-3] = low >> (HOST_BITS_PER_LONG - 1) >> 1;
 	  r->sig[SIGSZ-4] = low;
-	  if (SIGSZ > 4)
-	    memset (r->sig, 0, sizeof(long)*(SIGSZ-4));
 	}
       else
 	abort ();
diff -pu /view/renneckej-int-gcc-3.4.3/vob/sh5gcc.cmp/src/gcc/cp/parser.c cp/parser.c
--- /view/renneckej-int-gcc-3.4.3/vob/sh5gcc.cmp/src/gcc/cp/parser.c	2005-01-21 18:11:43.000000000 +0000
+++ cp/parser.c	2005-01-21 18:14:57.000000000 +0000
@@ -11522,6 +11522,9 @@ cp_parser_initializer_clause (cp_parser*
 {
   tree initializer = NULL_TREE;
 
+  /* Assume the expression is constant.  */
+  *non_constant_p = false;
+
   /* If it is not a `{', then we are looking at an
      assignment-expression.  */
   if (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE))

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