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]

[VTA] fix uninitialized access in combine


I'd introduced an uninitialized access in combine before.  This patch
fixes it.  I'm checking it in.

for  gcc/ChangeLog.vta
from  Alexandre Oliva  <aoliva@redhat.com>

	* combine.c (try_combine): Don't pass uninitialized i2src or
	i2dest to propagate_for_debug.

Index: gcc/combine.c
===================================================================
--- gcc/combine.c.orig	2008-04-02 03:40:02.000000000 -0300
+++ gcc/combine.c	2008-04-22 22:17:51.000000000 -0300
@@ -2369,7 +2369,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int
      I2 and not in I3, a REG_DEAD note must be made.  */
   rtx i3dest_killed = 0;
   /* SET_DEST and SET_SRC of I2 and I1.  */
-  rtx i2dest, i2src, i1dest = 0, i1src = 0;
+  rtx i2dest = 0, i2src = 0, i1dest = 0, i1src = 0;
   /* PATTERN (I1) and PATTERN (I2), or a copy of it in certain cases.  */
   rtx i1pat = 0, i2pat = 0;
   /* Indicates if I2DEST or I1DEST is in I2SRC or I1_SRC.  */
@@ -3745,7 +3745,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int
       }
     else
       {
-	if (MAY_HAVE_DEBUG_INSNS)
+	if (MAY_HAVE_DEBUG_INSNS && i2src)
 	  propagate_for_debug (i2, i3, i2dest, i2src, i3_subst_into_i2);
 	SET_INSN_DELETED (i2);
       }
-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}
FSFLA Board Member       ÂSÃ Libre! => http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}

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