diff mbox

[committed] Fix gimple-fold.c (PR tree-optimization/47074)

Message ID 20101229215150.GS16156@tyan-ft48-01.lab.bos.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Dec. 29, 2010, 9:51 p.m. UTC
Hi!

gimplify_and_update_call_from_tree was forgetting to call
pop_gimplify_context when returning early, keeping gimple_ctxp to
point somewhere into stack and causing corruption of whatever
happened to be on the stack at that spot afterwards.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
committed to trunk as obvious.

2010-12-29  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/47074
	* gimple-fold.c (gimplify_and_update_call_from_tree): Call
	pop_gimplify_context if returning early.


	Jakub
diff mbox

Patch

--- gcc/gimple-fold.c.jj	2010-12-28 12:33:08.000000000 +0100
+++ gcc/gimple-fold.c	2010-12-29 14:46:14.000000000 +0100
@@ -942,6 +942,7 @@  gimplify_and_update_call_from_tree (gimp
 	 which gets optimized away by C++ gimplification.  */
       if (gimple_seq_empty_p (stmts))
 	{
+	  pop_gimplify_context (NULL);
 	  if (gimple_in_ssa_p (cfun))
 	    {
 	      unlink_stmt_vdef (stmt);