This is the mail archive of the 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]

Patch for uninitialized variable bug in

I get this warning when cross-compiling to m68hc11-unknown-elf:
 > insn-output.c:1107: warning: `val' might be used uninitialized in this function

This one is an actual bug due to a problem in  The line in
question evaluates to:
val = (foo >= 0 && val < 0x100)

whereas for `val' to be initialized it should read:
(val = foo) >= 0 && val < 0x100

Tested by cross compiling cc1 to m68hc11-unknown-elf and verifying the
warning went away.

Ok to install on the trunk?


2002-09-16  Kaveh R. Ghazi  <>

	* (addhi_sp): Fix uninitialized variable bug.

diff -rup orig/egcc-CVS20020915/gcc/config/m68hc11/ egcc-CVS20020915/gcc/config/m68hc11/
--- orig/egcc-CVS20020915/gcc/config/m68hc11/	2002-09-14 15:24:45.000000000 -0400
+++ egcc-CVS20020915/gcc/config/m68hc11/	2002-09-16 11:02:09.616241571 -0400
@@ -2258,7 +2258,7 @@
      Register X/Y is lost, this is specified by the (clobber) statement.  */
   output_asm_insn (\"ts%3\", operands);
   if (GET_CODE (operands[2]) == CONST_INT
-      && ((val = INTVAL (operands[2]) >= 0 && val < 0x100))
+      && ((val = INTVAL (operands[2])) >= 0 && val < 0x100)
       && dead_register_here (insn, gen_rtx (REG, HImode, HARD_D_REGNUM)))
       output_asm_insn (\"ldab\\t%2\", operands);

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