diff mbox

enable -fprintf-return-value by default

Message ID 1e7776ca-c7f6-4d93-6b33-2c51dc5a8689@gmail.com
State New
Headers show

Commit Message

Martin Sebor Nov. 9, 2016, 3:13 a.m. UTC
The -fprintf-return-value optimization has been disabled since
the last time it caused a bootstrap failure on powerpc64le.  With
the underlying problems fixed GCC has bootstrapped fine on all of
powerpc64, powerpc64le and x86_64 and tested with no regressions.
I'd like to re-enable the option.  The attached patch does that.

Thanks
Martin

Comments

Sandra Loosemore Nov. 9, 2016, 5:05 p.m. UTC | #1
On 11/08/2016 08:13 PM, Martin Sebor wrote:
> The -fprintf-return-value optimization has been disabled since

> the last time it caused a bootstrap failure on powerpc64le.  With

> the underlying problems fixed GCC has bootstrapped fine on all of

> powerpc64, powerpc64le and x86_64 and tested with no regressions.

> I'd like to re-enable the option.  The attached patch does that.

>


> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi

> index 17c5c22..adebeff 100644

> --- a/gcc/doc/invoke.texi

> +++ b/gcc/doc/invoke.texi

> @@ -8301,7 +8301,7 @@ if (snprintf (buf, "%08x", i) >= sizeof buf)

>  The @option{-fprintf-return-value} option relies on other optimizations

>  and yields best results with @option{-O2}.  It works in tandem with the

>  @option{-Wformat-length} option.  The @option{-fprintf-return-value}

> -option is disabled by default.

> +option is enabled by default.

>

>  @item -fno-peephole

>  @itemx -fno-peephole2


Near the beginning of this chapter, in @node Invoking GCC, it says:

Many options have long names starting with @samp{-f} or with
@samp{-W}---for example,
@option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
these have both positive and negative forms; the negative form of
@option{-ffoo} is @option{-fno-foo}.  This manual documents
only one of these two forms, whichever one is not the default.

So you should be documenting the non-default negative form 
-fno-printf-return-value instead of the default positive form.  The 
corresponding entry in the list in @node Option Summary needs to be 
adjusted, too.

-Sandra
Jeff Law Nov. 18, 2016, 6:32 p.m. UTC | #2
On 11/08/2016 08:13 PM, Martin Sebor wrote:
> The -fprintf-return-value optimization has been disabled since

> the last time it caused a bootstrap failure on powerpc64le.  With

> the underlying problems fixed GCC has bootstrapped fine on all of

> powerpc64, powerpc64le and x86_64 and tested with no regressions.

> I'd like to re-enable the option.  The attached patch does that.

>

> Thanks

> Martin

>

>

> gcc-fprintf-return-value.diff

>

>

> gcc/c-family/ChangeLog:

>

> 	* c.opt (-fprintf-return-value): Enable by default.

>

> gcc/ChangeLog:

>

> 	* doc/invoke.texi (-fprintf-return-value): Document that option

> 	is enabled by default.

OK once you and Sandra are in-sync on the doc changes.

jeff
diff mbox

Patch

gcc/c-family/ChangeLog:

	* c.opt (-fprintf-return-value): Enable by default.

gcc/ChangeLog:

	* doc/invoke.texi (-fprintf-return-value): Document that option
	is enabled by default.

diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 7d8a726..9c9e83f 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -1534,7 +1534,7 @@  C++ ObjC++ Var(flag_pretty_templates) Init(1)
 -fno-pretty-templates Do not pretty-print template specializations as the template signature followed by the arguments.
 
 fprintf-return-value
-C ObjC C++ ObjC++ LTO Optimization Var(flag_printf_return_value) Init(0)
+C ObjC C++ ObjC++ LTO Optimization Var(flag_printf_return_value) Init(1)
 Treat known sprintf return values as constants.
 
 freplace-objc-classes
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 17c5c22..adebeff 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -8301,7 +8301,7 @@  if (snprintf (buf, "%08x", i) >= sizeof buf)
 The @option{-fprintf-return-value} option relies on other optimizations
 and yields best results with @option{-O2}.  It works in tandem with the
 @option{-Wformat-length} option.  The @option{-fprintf-return-value}
-option is disabled by default.
+option is enabled by default.
 
 @item -fno-peephole
 @itemx -fno-peephole2