public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [wwwdocs] Describe the new way command line options are handled with LTO
@ 2015-03-23  2:27 Jan Hubicka
  2015-03-23  2:45 ` Sandra Loosemore
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Hubicka @ 2015-03-23  2:27 UTC (permalink / raw)
  To: gcc-patches, gerald, rguenther, sandra

Hi,
this is my honest attempt to explain how command line options works with LTO
in current compiler and how to deal with these sanely.

It is bit of mess, but an improvement over past releases.  We finished the
transition to per-function attributes.  In GCC 6 I plan to add per-variable
counterpart.  I wonder if we want to have something in the texinfo too?

Honza

Index: changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-5/changes.html,v
retrieving revision 1.90
diff -u -r1.90 changes.html
--- changes.html	23 Mar 2015 02:00:12 -0000	1.90
+++ changes.html	23 Mar 2015 02:22:51 -0000
@@ -78,6 +78,25 @@
 	  Streaming extra information needed to merge types adds about 2-6% of
 	  memory size and object size increase. This can be controlled by
 	  <code>-flto-odr-type-merging</code>.</li>
+      <li><p>Command line optimization and target options are now streamed on
+	  per-function basis and honored by the link-time optimizer.
+	  This change makes the link-time optimization more tranpsarent
+	  replacement of the per-file optimization.
+	  It is now possible to build projects that require different optimization
+	  settings for different translation units (such as
+	  <code>-ffast-math</code>, <code>-mavx</code>, or <code>-finline</code>).
+	  Contrary to the earlier GCC releases, the optimization and target
+	  options passed to the command line invoking linker are ignored.</p>
+	  <p>Note that this apply only to those command
+	  line options that can be passed to <code>optimize</code> and
+	  <code>target</code> attributes.  Command line options affecting global
+	  code generation (such as <code>-fpic</code>), warnings
+	  (such as <code>-Wodr</code>), optimization affecting way static variables
+	  are optimized (such as <code>-fcommon</code>), debug output (such as
+	  <code>-g</code>) and <code>--param</code> parameters can be applied only
+	  to the whole link-time optimization unit. 
+	  It these cases it is recommended to consistently use the same setting
+	  both at compile-time and link-time.</p>
       <li>GCC bootstrap now uses slim LTO object files.</li>
       <li>Memory usage and link times were improved.  Tree merging was sped up,
 	  memory usage of GIMPLE declarations and types was reduced, and,

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

* Re: [wwwdocs] Describe the new way command line options are handled with LTO
  2015-03-23  2:27 [wwwdocs] Describe the new way command line options are handled with LTO Jan Hubicka
@ 2015-03-23  2:45 ` Sandra Loosemore
  2015-03-23  4:12   ` Jan Hubicka
  0 siblings, 1 reply; 3+ messages in thread
From: Sandra Loosemore @ 2015-03-23  2:45 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: gcc-patches, gerald, rguenther

On 03/22/2015 08:26 PM, Jan Hubicka wrote:
> Hi,
> this is my honest attempt to explain how command line options works with LTO
> in current compiler and how to deal with these sanely.
> 
> It is bit of mess, but an improvement over past releases.  We finished the
> transition to per-function attributes.  In GCC 6 I plan to add per-variable
> counterpart.  I wonder if we want to have something in the texinfo too?
> 
> Honza
> 
> Index: changes.html
> ===================================================================
> RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-5/changes.html,v
> retrieving revision 1.90
> diff -u -r1.90 changes.html
> --- changes.html	23 Mar 2015 02:00:12 -0000	1.90
> +++ changes.html	23 Mar 2015 02:22:51 -0000
> @@ -78,6 +78,25 @@
>   	  Streaming extra information needed to merge types adds about 2-6% of
>   	  memory size and object size increase. This can be controlled by
>   	  <code>-flto-odr-type-merging</code>.</li>
> +      <li><p>Command line optimization and target options are now streamed on
> +	  per-function basis and honored by the link-time optimizer.
> +	  This change makes the link-time optimization more tranpsarent
> +	  replacement of the per-file optimization.
> +	  It is now possible to build projects that require different optimization
> +	  settings for different translation units (such as
> +	  <code>-ffast-math</code>, <code>-mavx</code>, or <code>-finline</code>).
> +	  Contrary to the earlier GCC releases, the optimization and target
> +	  options passed to the command line invoking linker are ignored.</p>
> +	  <p>Note that this apply only to those command
> +	  line options that can be passed to <code>optimize</code> and
> +	  <code>target</code> attributes.  Command line options affecting global
> +	  code generation (such as <code>-fpic</code>), warnings
> +	  (such as <code>-Wodr</code>), optimization affecting way static variables
> +	  are optimized (such as <code>-fcommon</code>), debug output (such as
> +	  <code>-g</code>) and <code>--param</code> parameters can be applied only
> +	  to the whole link-time optimization unit.
> +	  It these cases it is recommended to consistently use the same setting
> +	  both at compile-time and link-time.</p>
>         <li>GCC bootstrap now uses slim LTO object files.</li>
>         <li>Memory usage and link times were improved.  Tree merging was sped up,
>   	  memory usage of GIMPLE declarations and types was reduced, and,
> 

How about this for a copy-edited version of the new text?

       <li><p>Command-line optimization and target options are now streamed on
	  a per-function basis and honored by the link-time optimizer.
	  This change makes the link-time optimization a more transparent
	  replacement of per-file optimizations.
	  It is now possible to build projects that require
	  different optimization
	  settings for different translation units (such as
	  <code>-ffast-math</code>, <code>-mavx</code>, or
	  <code>-finline</code>).
	  Contrary to the earlier GCC releases, the optimization and target
	  options passed on the link command line are ignored.</p>
	  <p>Note that this applies only to those command-line options
	  that can be passed to <code>optimize</code> and
	  <code>target</code> attributes.
	  Command-line options affecting global code generation
	  (such as <code>-fpic</code>), warnings
	  (such as <code>-Wodr</code>),
	  optimizations affecting the way static variables
	  are optimized (such as <code>-fcommon</code>), debug output (such as
	  <code>-g</code>),
	  and <code>--param</code> parameters can be applied only
	  to the whole link-time optimization unit. 
	  In these cases, it is recommended to consistently use the same
	  options at both compile time and link time.</p></li>

-Sandra

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

* Re: [wwwdocs] Describe the new way command line options are handled with LTO
  2015-03-23  2:45 ` Sandra Loosemore
@ 2015-03-23  4:12   ` Jan Hubicka
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Hubicka @ 2015-03-23  4:12 UTC (permalink / raw)
  To: Sandra Loosemore; +Cc: Jan Hubicka, gcc-patches, gerald, rguenther

> How about this for a copy-edited version of the new text?

Sounds good to me. Thanks, Sandra.

Honza
> 
>        <li><p>Command-line optimization and target options are now streamed on
> 	  a per-function basis and honored by the link-time optimizer.
> 	  This change makes the link-time optimization a more transparent
> 	  replacement of per-file optimizations.
> 	  It is now possible to build projects that require
> 	  different optimization
> 	  settings for different translation units (such as
> 	  <code>-ffast-math</code>, <code>-mavx</code>, or
> 	  <code>-finline</code>).
> 	  Contrary to the earlier GCC releases, the optimization and target
> 	  options passed on the link command line are ignored.</p>
> 	  <p>Note that this applies only to those command-line options
> 	  that can be passed to <code>optimize</code> and
> 	  <code>target</code> attributes.
> 	  Command-line options affecting global code generation
> 	  (such as <code>-fpic</code>), warnings
> 	  (such as <code>-Wodr</code>),
> 	  optimizations affecting the way static variables
> 	  are optimized (such as <code>-fcommon</code>), debug output (such as
> 	  <code>-g</code>),
> 	  and <code>--param</code> parameters can be applied only
> 	  to the whole link-time optimization unit. 
> 	  In these cases, it is recommended to consistently use the same
> 	  options at both compile time and link time.</p></li>
> 
> -Sandra

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

end of thread, other threads:[~2015-03-23  4:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-23  2:27 [wwwdocs] Describe the new way command line options are handled with LTO Jan Hubicka
2015-03-23  2:45 ` Sandra Loosemore
2015-03-23  4:12   ` Jan Hubicka

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