public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] Fix one issue reported by valgrind (PR other/58712)
@ 2014-01-15  8:14 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2014-01-15  8:14 UTC (permalink / raw)
  To: gcc-patches

Hi!

When memcpy has constant length, we leave probable_max_size uninitialized
and later on create a CONST_INT out of it.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
committed to trunk as obvious.

2014-01-15  Jakub Jelinek  <jakub@redhat.com>

	PR other/58712
	* builtins.c (determine_block_size): Initialize *probable_max_size
	even if len_rtx is CONST_INT.

--- gcc/builtins.c.jj	2014-01-13 13:26:37.000000000 +0100
+++ gcc/builtins.c	2014-01-13 18:21:13.299612871 +0100
@@ -3117,7 +3117,7 @@ determine_block_size (tree len, rtx len_
 {
   if (CONST_INT_P (len_rtx))
     {
-      *min_size = *max_size = UINTVAL (len_rtx);
+      *min_size = *max_size = *probable_max_size = UINTVAL (len_rtx);
       return;
     }
   else
@@ -3131,7 +3131,8 @@ determine_block_size (tree len, rtx len_
       else
 	*min_size = 0;
       if (tree_fits_uhwi_p (TYPE_MAX_VALUE (TREE_TYPE (len))))
-	*probable_max_size = *max_size = tree_to_uhwi (TYPE_MAX_VALUE (TREE_TYPE (len)));
+	*probable_max_size = *max_size
+	  = tree_to_uhwi (TYPE_MAX_VALUE (TREE_TYPE (len)));
       else
 	*probable_max_size = *max_size = GET_MODE_MASK (GET_MODE (len_rtx));
 

	Jakub

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-01-15  8:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-15  8:14 [committed] Fix one issue reported by valgrind (PR other/58712) Jakub Jelinek

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