public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* fno-branch-count-reg misleading documentation woes
@ 2008-05-28  7:51 Christian BRUEL
  0 siblings, 0 replies; only message in thread
From: Christian BRUEL @ 2008-05-28  7:51 UTC (permalink / raw)
  To: gcc

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}.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-05-28  7:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-28  7:51 fno-branch-count-reg misleading documentation woes Christian BRUEL

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).