hello,
The documentation for -fno-branch-count-reg explains that a
dec-and-test-branch instruction is replaced by an equivalent sequence of
instruction that decrement a register, compare it against 0, and branch.
(see the use of the world *instead*)
This is not really true, since this option firstly disables the loop
reversal transformation (loop-init.c::gate_rtl_doloop). As such, the
generated code will not necessary have an inversed decrement loop count
created and the sequence of reg testing will not be necessary a
decrement-test-branch sequence.
another comment: -fbranch-count-reg the instruction is not necessary a
"decrement and branch" but could also be a "decrement and compare" like
on the SH.
would a rephrasing like the following be more accurate ?
thanks.
-c
Index: invoke.texi
===================================================================
--- invoke.texi (revision 135611)
+++ invoke.texi (working copy)
@@ -5420,10 +5420,7 @@
@item -fno-branch-count-reg
@opindex fno-branch-count-reg
-Do not use ``decrement and branch'' instructions on a count register,
-but instead generate a sequence of instructions that decrement a
-register, compare it against zero, then branch based upon the result.
-This option is only meaningful on architectures that support such
+Do not use ``decrement and branch/compare'' instructions on a count
register. By setting this flag, loop inversion will be disabled. This
option is only meaningful on architectures that support such
instructions, which include x86, PowerPC, IA-64 and S/390.
The default is @option{-fbranch-count-reg}.