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

REG_NONNEG confusion


rtl.texi says:

  @findex REG_NONNEG
  @item REG_NONNEG
  The register @var{op} is known to have a nonnegative value when this
  insn is reached.  This is used so that decrement and branch until zero
  instructions, such as the m68k dbra, can be matched.

  The @code{REG_NONNEG} note is added to insns only if the machine
  description has a @samp{decrement_and_branch_until_zero} pattern.

loop.c contains

          /* register always nonnegative, add REG_NOTE to branch */
          REG_NOTES (PREV_INSN (loop_end))
            = gen_rtx_EXPR_LIST (REG_NONNEG, NULL_RTX,
                                 REG_NOTES (PREV_INSN (loop_end)));

I don't see the register being specified as part of the note.  Is the
documentation wrong or the code?  Personally I'm inclined to change the
code.

BTW, any reason to restrict REG_NONNEG to machine descriptions which
have decrement_and_branch_until_zero?  I was thinking of having VRP
always add them to simple branches since it can basically be done for
"free".

-- John
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------


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