public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] 19705 - -fno-branch-count-reg doesn't prevent decrement and branch instructions on a count register
@ 2016-02-11 21:58 Martin Sebor
  2016-02-19  3:39 ` Martin Sebor
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Sebor @ 2016-02-11 21:58 UTC (permalink / raw)
  To: Gcc Patch List; +Cc: Andrew Pinski

[-- Attachment #1: Type: text/plain, Size: 535 bytes --]

The more than decennnial rtl-optimization/19705 - -fno-branch-count-reg
doesn't prevent decrement and branch instructions on a count register
points out that the documentation of the option leads one to expect
that it prevents the decrement and branch instruction from appearing
in the instruction stream.  This isn't the case  The option prevents
a dedicated pass from running that introduces such instructions, but
it doesn't prevent other passes from introducing it.  The attached
updates the documentation to clarify this.

Martin

[-- Attachment #2: gcc-19705.patch --]
[-- Type: text/x-patch, Size: 1561 bytes --]

PR rtl-optimization/19705 - -fno-branch-count-reg doesn't prevent decrement
	and branch instructions on a count register

gcc/ChangeLog:
2016-02-11  Martin Sebor  <msebor@redhat.com>

	PR rtl-optimization/19705
	* doc/invoke.texi (Options That Control Optimization): Clarify
	-fno-branch-count-reg.

Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi	(revision 233355)
+++ gcc/doc/invoke.texi	(working copy)
@@ -6513,11 +6513,14 @@ life-range analysis.  This option is eff
 
 @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
-instructions, which include x86, PowerPC, IA-64 and S/390.
+Avoid running a pass scanning for opportunities to use ``decrement and
+branch'' instructions on a count register instead of generating sequences
+of instructions that decrement a register, compare it against zero, and
+then branch based upon the result.  This option is only meaningful on
+architectures that support such instructions, which include x86, PowerPC,
+IA-64 and S/390.  Note that the @option{-fno-branch-count-reg} option
+doesn't remove the decrement and branch instructions from the generated
+instruction stream introduced by other optimization passes.
 
 Enabled by default at @option{-O1} and higher.
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] 19705 - -fno-branch-count-reg doesn't prevent decrement and branch instructions on a count register
  2016-02-11 21:58 [PATCH] 19705 - -fno-branch-count-reg doesn't prevent decrement and branch instructions on a count register Martin Sebor
@ 2016-02-19  3:39 ` Martin Sebor
  2016-02-19 21:46   ` Jeff Law
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Sebor @ 2016-02-19  3:39 UTC (permalink / raw)
  To: Gcc Patch List; +Cc: Andrew Pinski

Ping:

https://gcc.gnu.org/ml/gcc-patches/2016-02/msg00809.html

On 02/11/2016 02:58 PM, Martin Sebor wrote:
> The more than decennnial rtl-optimization/19705 - -fno-branch-count-reg
> doesn't prevent decrement and branch instructions on a count register
> points out that the documentation of the option leads one to expect
> that it prevents the decrement and branch instruction from appearing
> in the instruction stream.  This isn't the case  The option prevents
> a dedicated pass from running that introduces such instructions, but
> it doesn't prevent other passes from introducing it.  The attached
> updates the documentation to clarify this.
>
> Martin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] 19705 - -fno-branch-count-reg doesn't prevent decrement and branch instructions on a count register
  2016-02-19  3:39 ` Martin Sebor
@ 2016-02-19 21:46   ` Jeff Law
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Law @ 2016-02-19 21:46 UTC (permalink / raw)
  To: Martin Sebor, Gcc Patch List; +Cc: Andrew Pinski

On 02/18/2016 08:39 PM, Martin Sebor wrote:
> Ping:
>
> https://gcc.gnu.org/ml/gcc-patches/2016-02/msg00809.html
>
> On 02/11/2016 02:58 PM, Martin Sebor wrote:
>> The more than decennnial rtl-optimization/19705 - -fno-branch-count-reg
>> doesn't prevent decrement and branch instructions on a count register
>> points out that the documentation of the option leads one to expect
>> that it prevents the decrement and branch instruction from appearing
>> in the instruction stream.  This isn't the case  The option prevents
>> a dedicated pass from running that introduces such instructions, but
>> it doesn't prevent other passes from introducing it.  The attached
>> updates the documentation to clarify this
I'm not even sure why we have this option to begin with.  One could 
easily argue that it's mis-named or should just go away.

In the mean time, your patch at least clarifies what it really does, so 
it's fine for the trunk.

jeff

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-19 21:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-11 21:58 [PATCH] 19705 - -fno-branch-count-reg doesn't prevent decrement and branch instructions on a count register Martin Sebor
2016-02-19  3:39 ` Martin Sebor
2016-02-19 21:46   ` Jeff Law

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