This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFA] A small fix for IRA
- From: Jie Zhang <jie at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 08 Mar 2010 10:01:50 +0800
- Subject: [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],