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]

[RFA] A small fix for IRA


When working on a GCC bug, I found this. We should use `-' instead of `+', otherwise "use + 1" would fall out of the array boundary. Is it OK?


-- Jie Zhang CodeSourcery (650) 331-3385 x735
	* ira-lives.c (check_and_make_def_use_conflict): Don't fall
	out array boundary.

Index: ira-lives.c
===================================================================
--- ira-lives.c	(revision 157269)
+++ ira-lives.c	(working copy)
@@ -456,7 +456,7 @@ check_and_make_def_use_conflict (rtx dre
      different.  (Indeed, if the constraints for the two
      operands are the same for all alternatives, there's no
      point marking them as commutative.)  */
-  if (use < recog_data.n_operands + 1
+  if (use < recog_data.n_operands - 1
       && recog_data.constraints[use][0] == '%')
     advance_p
       = make_pseudo_conflict (recog_data.operand[use + 1],

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