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]

Dataflow branch review #3


A few more notes on the dataflow branch.

Ian

In combine.c:

+static rtx *find_single_use_1 (rtx, rtx *);
+/* This is used by find_single_use to locate an rtx that contains exactly one
+   use of DEST, which is typically either a REG or CC0.  It returns a
+   pointer to the innermost rtx expression containing DEST.  Appearances of
+   DEST that are being used to totally replace it are not counted.  */
+
+static rtx *
+find_single_use_1 (rtx dest, rtx *loc)
+{
+  rtx x = *loc;
+  enum rtx_code code = GET_CODE (x);
+  rtx *result = 0;
+  rtx *this_result;
+  int i;
+  const char *fmt;

Mention the LOC parameter in the comment before the function.
Initialize RESULT to NULL, not 0.

+	  if (result == 0)
+	    result = this_result;
+	  else if (this_result)
+	    /* Duplicate usage.  */
+	    return 0;

Compare against NULL, not 0.  Return NULL, not 0.  And likewise in the
similar code immediately following.

In general try to write this sort of function using for_each_rtx, but
that can wait for later.


Before the function find_single_use:

+   This routine will return usually zero either before flow is called (because
+   there will be no LOG_LINKS notes) or after reload (because the REG_DEAD
+   note can't be trusted).

This function is now static in combine.c, so this comment is
meaningless and should be removed.


In delete_noop_moves:

+	      if ((note = find_reg_note (insn, REG_LIBCALL, NULL_RTX))
+		       && XEXP (note, 0) != insn)
+		{
+		  rtx new_libcall_insn = next_real_insn (insn);
+		  rtx retval_note = find_reg_note (XEXP (note, 0),
+						   REG_RETVAL, NULL_RTX);
+continue;
+		  REG_NOTES (new_libcall_insn)
+		    = gen_rtx_INSN_LIST (REG_LIBCALL, XEXP (note, 0),
+					 REG_NOTES (new_libcall_insn));
+		  XEXP (retval_note, 0) = new_libcall_insn;
+		}

That "continue" looks very wrong.  I think what you are trying to say
is that a move insn with a REG_LIBCALL note should not be deleted.
This needs to be cleaned up.


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