This is the mail archive of the 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]

About standard_iv_increment_position


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

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

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;

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