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]

Fix missing initialisation of variable in sbitmap_union_of_preds()


Hi Guys,

  I am checking in the patch below as an obvious fix.  The variable
  'e' was declared and initialised to NULL at the start of
  sbitmap_union_of_preds(), but then it was used inside the first for
  loop without being given a non-NULL value.  The obvious intention of
  the code is that it should have been set to the ix'th edge
  predecessor and so that is what this patch does.

  Discovered and verified as fixed by building the sh64-elf
  toolchain.
  
Cheers
  Nick

gcc/ChangeLog
2004-11-22  Nick Clifton  <nickc@redhat.com>

	* sbitmap.c (sbitmap_union_of_preds): Set 'e' to the next edge
	predecessor in the first for-loop.

Index: gcc/sbitmap.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/sbitmap.c,v
retrieving revision 1.35
diff -c -3 -p -r1.35 sbitmap.c
*** gcc/sbitmap.c	22 Oct 2004 17:05:06 -0000	1.35
--- gcc/sbitmap.c	22 Nov 2004 09:49:19 -0000
*************** sbitmap_union_of_preds (sbitmap dst, sbi
*** 638,643 ****
--- 638,644 ----
  
    for (e = NULL, ix = 0; ix < EDGE_COUNT (b->preds); ix++)
      {
+       e = EDGE_PRED (b, ix);
        if (e->src== ENTRY_BLOCK_PTR)
  	continue;
  
  


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