Patchwork Fix PR rtl-optimization/50615

login
register
mail settings
Submitter Eric Botcazou
Date Oct. 16, 2011, 1:14 p.m.
Message ID <201110161514.00816.ebotcazou@adacore.com>
Download mbox | patch
Permalink /patch/120036/
State New
Headers show

Comments

Eric Botcazou - Oct. 16, 2011, 1:14 p.m.
This is the failure of the new assertion added in the REG_ARGS_SIZE case of 
distribute_notes in the combiner on a degenerated case (complete folding of a 
dynamic stack allocation).  Fixed by dropping the note if the resulting insn 
is a no-op move.

Tested on i586-suse-linux, applied on the mainline.


2011-10-16  Eric Botcazou  <ebotcazou@adacore.com>

	PR rtl-optimization/50615
	* combine.c (distribute_notes) <REG_ARGS_SIZE>: Skip if I3 is a no-op.


2011-10-16  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc.dg/vla-23.c: New test.

Patch

Index: combine.c
===================================================================
--- combine.c	(revision 179844)
+++ combine.c	(working copy)
@@ -13274,13 +13274,14 @@  distribute_notes (rtx notes, rtx from_in
 	  break;
 
 	case REG_ARGS_SIZE:
-	  {
-	    /* ??? How to distribute between i3-i1.  Assume i3 contains the
-	       entire adjustment.  Assert i3 contains at least some adjust.  */
-	    int old_size, args_size = INTVAL (XEXP (note, 0));
-	    old_size = fixup_args_size_notes (PREV_INSN (i3), i3, args_size);
-	    gcc_assert (old_size != args_size);
-	  }
+	  /* ??? How to distribute between i3-i1.  Assume i3 contains the
+	     entire adjustment.  Assert i3 contains at least some adjust.  */
+	  if (!noop_move_p (i3))
+	    {
+	      int old_size, args_size = INTVAL (XEXP (note, 0));
+	      old_size = fixup_args_size_notes (PREV_INSN (i3), i3, args_size);
+	      gcc_assert (old_size != args_size);
+	    }
 	  break;
 
 	case REG_NORETURN: