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]

[committed] Fix misplaced else in vt_expand_loc_callback


Hi!

I've noticed a bug in vt_expand_loc_callback - else was in a wrong
block, so if in dummy mode cselib_dummy_expand_value_rtx_cb failed,
cselib_expand_value_rtx_cb would be called (and fail again, but
possibly create GC garbage and waste CPU time), while it wouldn't
be called at all in non-dummy mode (which isn't that bad, as in non-dummy
mode dv_changed_p should be false).

Fixed thusly, committed as obvious after bootstrapping/regtesting on
x86_64-linux and i686-linux.

2010-03-26  Jakub Jelinek  <jakub@redhat.com>

	* var-tracking.c (vt_expand_loc_callback): Don't run
	cselib_expand_value_rtx_cb in dummy mode if
	cselib_dummy_expand_value_rtx_cb returned false.

--- gcc/var-tracking.c.jj	2010-03-26 17:22:07.000000000 +0100
+++ gcc/var-tracking.c	2010-03-26 19:43:26.000000000 +0100
@@ -6860,14 +6860,13 @@ vt_expand_loc_callback (rtx x, bitmap re
 		result = pc_rtx;
 		break;
 	      }
-	    else
-	      {
-		result = cselib_expand_value_rtx_cb (loc->loc, regs, max_depth,
-						     vt_expand_loc_callback,
-						     data);
-		if (result)
-		  break;
-	      }
+	  }
+	else
+	  {
+	    result = cselib_expand_value_rtx_cb (loc->loc, regs, max_depth,
+						 vt_expand_loc_callback, data);
+	    if (result)
+	      break;
 	  }
       if (dummy && (result || var->var_part[0].cur_loc))
 	var->cur_loc_changed = true;

	Jakub


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