This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
About standard_iv_increment_position
- From: Sebastian Pop <sebastian dot pop at cri dot ensmp dot fr>
- To: rakdver at atrey dot karlin dot mff dot cuni dot cz
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 28 Jan 2005 14:55:38 +0100
- Subject: About standard_iv_increment_position
Hello,
I was trying to make the code for unifying wrap around variables to
work on some spec programs, and I've seen that the reason it is
failing is because I insert the increment of the new IV at the wrong
place.
Then I've seen that there is a function standard_iv_increment_position
that is supposed to return the right position for inserting the new IV.
The first remark is that this function is not used in mainline nor in
autovect. It seems to me that the arguments of create_iv should be
computed using standard_iv_increment_position, thus some cleanup
changes should be considered to tree-loop-linear.c and to
tree-vectorizer.c.
The second remark is that standard_iv_increment_position will return a
block_stmt_iterator and a position that is invalid for verify_flow_info,
as shown in the following case that fails:
if (_n_413 < N_60) goto <L5>; else goto <L23>;
ivtmp.1076_499 = ivtmp.1076_498 + 1;
Here, the IV update is inserted after the jump. I propose the
following patch for correcting this behavior:
Index: tree-ssa-loop-manip.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop-manip.c,v
retrieving revision 2.21
diff -d -u -p -r2.21 tree-ssa-loop-manip.c
--- tree-ssa-loop-manip.c 29 Nov 2004 17:53:47 -0000 2.21
+++ tree-ssa-loop-manip.c 28 Jan 2005 13:48:11 -0000
@@ -504,7 +504,7 @@ standard_iv_increment_position (struct l
|| (last && TREE_CODE (last) != LABEL_EXPR))
{
*bsi = bsi_last (latch);
- *insert_after = true;
+ *insert_after = false;
}
else
{