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 PR debug/46375


This is another -fcompare-debug failure.  Fixed by not marking the basic block 
dirty in remove_insn if the removed insn is a debug insn.

Bootstrapped/regtested on x86_64-suse-linux, applied on the mainline.


2010-11-12  Eric Botcazou  <ebotcazou@adacore.com>

	PR debug/46375
	* emit-rtl.c (remove_insn): Do not mark BBs upon debug insns.


2010-11-12  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc.dg/pr46375.c: New test.


-- 
Eric Botcazou
Index: emit-rtl.c
===================================================================
--- emit-rtl.c	(revision 166490)
+++ emit-rtl.c	(working copy)
@@ -3867,7 +3867,7 @@ remove_insn (rtx insn)
   if (!BARRIER_P (insn)
       && (bb = BLOCK_FOR_INSN (insn)))
     {
-      if (INSN_P (insn))
+      if (NONDEBUG_INSN_P (insn))
 	df_set_bb_dirty (bb);
       if (BB_HEAD (bb) == insn)
 	{
/* PR debug/46375 */
/* Reported by Zdenek Sojka <zsojka@seznam.cz> */
/* { dg-do compile } */
/* { dg-options "-fgcse -fno-tree-dominator-opts -fcompare-debug -O" } */

void bar (void);

void
foo (int **pp)
{
  int *p = 0;
  if (pp)
    p = *pp;
  if (p && *p)
    bar ();
}

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