diff mbox

[wwwdocs] Document in changes.html -fcode-hoisting, -fipa-bit-cp, -fipa-vrp, -fsplit-loops, GCJ removal, x86 ISA additions, -fshrink-wrap-separate etc.

Message ID alpine.LSU.2.20.1702261513010.2487@anthias.pfeifer.com
State New
Headers show

Commit Message

Gerald Pfeifer Feb. 26, 2017, 2:21 p.m. UTC
On Sun, 19 Feb 2017, Gerald Pfeifer wrote:
> That was quite a bit; thanks for doing that, Jakub!
> 
> In the patch below I try to streamline language a bit, document options 
> being implied by -Os (in addition to -O2 or higher), fix grammar in a few 
> places, and change a textual link to being a real one.
> 
> I have _not_ applied this yet, and would appreciate your feedback.

I did another two passes through this, making a few more simplifications
and changes, and committed it.

If you see anything beyond it, or changes you disagree with, let me know!

Gerald

Comments

Martin Sebor Feb. 27, 2017, 4:25 p.m. UTC | #1
On 02/26/2017 07:21 AM, Gerald Pfeifer wrote:
> On Sun, 19 Feb 2017, Gerald Pfeifer wrote:
>> That was quite a bit; thanks for doing that, Jakub!
>>
>> In the patch below I try to streamline language a bit, document options
>> being implied by -Os (in addition to -O2 or higher), fix grammar in a few
>> places, and change a textual link to being a real one.
>>
>> I have _not_ applied this yet, and would appreciate your feedback.
>
> I did another two passes through this, making a few more simplifications
> and changes, and committed it.
>
> If you see anything beyond it, or changes you disagree with, let me know!
>
> @@ -525,8 +524,8 @@
>  <li>New <code>__builtin_add_overflow_p</code>,
>    <code>__builtin_sub_overflow_p</code>,
>    <code>__builtin_mul_overflow_p</code> built-in functions have been added.
> -  These work similarly to earlier added built-in functions without the
> -  <code>_p</code> suffix, but don't actually store the result of the
> +  These work similarly to their siblings without the
> +  <code>_p</code> suffix, but do not actually store the result of the
>    arithmetics anywhere, just return whether the operation would overflow.
>    These builtins allow easy checking for overflows e.g. in C++
>    <code>constexpr</code> contexts.</li>

Sorry to be jumping in so late. I only noticed this bit now.

I would suggest to say that these new built-ins evaluate to integer
constant expressions when their arguments do.  Not all C programmers
are familiar with C++ constexpr so they may not understand the use
use case.  The request for these built-ins also came from a C user
and was specifically motivated by avoiding -Woverflow warnings so
adding an example demonstrating that might be helpful as well.
Something like this:

   ... Calls to these built-ins with integer constant arguments
   evaluate to integer constants expressions.</p>
   <p>For example, in the following, <code>c</code> is assigned
   the result of <code>a * b</code> only if the multiplication
   does not overflow, otherwise it is assigned the value zero.
   The multiplication is performed at compile-time and without
   triggering a <code>-Woverflow</code> warning.
   <blockquote>
     <pre>enum {
   a = 12345678,
   b = 87654321,
   c = __builtin_mul_overflow_p (a, b, a) ? 0 : a * b
};</pre>
   </blockquote></li>

Martin
Gerald Pfeifer March 12, 2017, 11:23 p.m. UTC | #2
Hi Martin,

On Mon, 27 Feb 2017, Martin Sebor wrote:
> Sorry to be jumping in so late. I only noticed this bit now.
> 
> I would suggest to say that these new built-ins evaluate to integer
> constant expressions when their arguments do.  Not all C programmers
> are familiar with C++ constexpr so they may not understand the use
> use case.  The request for these built-ins also came from a C user
> and was specifically motivated by avoiding -Woverflow warnings so
> adding an example demonstrating that might be helpful as well.
> Something like this:
> 
>   ... Calls to these built-ins with integer constant arguments
>   evaluate to integer constants expressions.</p>
>   <p>For example, in the following, <code>c</code> is assigned
>   the result of <code>a * b</code> only if the multiplication
>   does not overflow, otherwise it is assigned the value zero.
>   The multiplication is performed at compile-time and without
>   triggering a <code>-Woverflow</code> warning.

</p>

>   <blockquote>
>     <pre>enum {
>   a = 12345678,
>   b = 87654321,
>   c = __builtin_mul_overflow_p (a, b, a) ? 0 : a * b
> };</pre>
>   </blockquote></li>

this works for me, modulo the closing </p> which I believe will be
necessary.  Were you seeing approval for this from someone?  (If so,
that may not have been me. ;-)

Gerald
Martin Sebor March 14, 2017, 7:43 p.m. UTC | #3
On 03/12/2017 05:23 PM, Gerald Pfeifer wrote:
> Hi Martin,
>
> On Mon, 27 Feb 2017, Martin Sebor wrote:
>> Sorry to be jumping in so late. I only noticed this bit now.
>>
>> I would suggest to say that these new built-ins evaluate to integer
>> constant expressions when their arguments do.  Not all C programmers
>> are familiar with C++ constexpr so they may not understand the use
>> use case.  The request for these built-ins also came from a C user
>> and was specifically motivated by avoiding -Woverflow warnings so
>> adding an example demonstrating that might be helpful as well.
>> Something like this:
>>
>>   ... Calls to these built-ins with integer constant arguments
>>   evaluate to integer constants expressions.</p>
>>   <p>For example, in the following, <code>c</code> is assigned
>>   the result of <code>a * b</code> only if the multiplication
>>   does not overflow, otherwise it is assigned the value zero.
>>   The multiplication is performed at compile-time and without
>>   triggering a <code>-Woverflow</code> warning.
>
> </p>
>
>>   <blockquote>
>>     <pre>enum {
>>   a = 12345678,
>>   b = 87654321,
>>   c = __builtin_mul_overflow_p (a, b, a) ? 0 : a * b
>> };</pre>
>>   </blockquote></li>
>
> this works for me, modulo the closing </p> which I believe will be
> necessary.  Were you seeing approval for this from someone?  (If so,
> that may not have been me. ;-)

Thanks.  I just committed it.

Martin
diff mbox

Patch

Index: gcc-7/changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-7/changes.html,v
retrieving revision 1.66
diff -u -r1.66 changes.html
--- gcc-7/changes.html	24 Feb 2017 05:19:19 -0000	1.66
+++ gcc-7/changes.html	26 Feb 2017 14:19:09 -0000
@@ -50,41 +50,40 @@ 
     <code>-fprintf-return-value</code> option.</li>
   <li>A new store merging pass has been added.  It merges constant stores to
   adjacent memory locations into fewer, wider, stores.
-  It can be enabled by using the <code>-fstore-merging</code> option and is
-  enabled by default at the <code>-O2</code> optimization
-  level or higher (including <code>-Os</code>).</li>
+  It is enabled by the <code>-fstore-merging</code> option and at the
+  <code>-O2</code> optimization level or higher (and <code>-Os</code>).</li>
 
   <li>A new code hoisting optimization has been added to the partial
   redundancy elimination pass.  It attempts to move evaluation of
   expressions executed on all paths to the function exit as early as
   possible, which helps primarily for code size, but can be useful for
-  speed of generated code as well.  It can be enabled by using the
-  <code>-fcode-hoisting</code> option and is enabled by default at
-  the <code>-O2</code> optimization level or higher.</li>
+  speed of generated code as well.  It is enabled by the
+  <code>-fcode-hoisting</code> option and at the <code>-O2</code>
+  optimization level or higher (and <code>-Os</code>).</li>
 
   <li>A new interprocedural bitwise constant propagation optimization
   has been added, which propagates knowledge about which bits of variables
   are known to be zero (including pointer alignment information) across
-  the call graph.  It can be enabled by using the <code>-fipa-bit-cp</code>
-  option if <code>-fipa-cp</code> is enabled as well, and is enabled by
-  default at the <code>-O2</code> optimization level and higher.</li>
+  the call graph.  It is enabled by the <code>-fipa-bit-cp</code>
+  option if <code>-fipa-cp</code> is enabled as well, and is enabled
+  at the <code>-O2</code> optimization level and higher (and
+  <code>-Os</code>).</li>
 
   <li>A new interprocedural value range propagation optimization has been
   added, which propagates integral ranges that variable values can be proven
-  to be within across the call graph.  It can be enabled by using the
-  <code>-fipa-vrp</code> option and is enabled by default at the
-  <code>-O2</code> optimization level and higher.</li>
+  to be within across the call graph.  It is enabled by the
+  <code>-fipa-vrp</code> option and at the <code>-O2</code> optimization
+  level and higher (and <code>-Os</code>).</li>
 
   <li>A new loop splitting optimization pass has been added.  It splits
   certain loops if they contain a condition that is always true on one
   side of the iteration space and always false on the other into two
   loops where each of the new two loops iterates just on one of the sides
   of the iteration space and the condition does not need to be checked
-  inside of the loop.  It can be enabled by using the
-  <code>-fsplit-loops</code> option and is enabled by default at the
-  <code>-O3</code> optimization level or higher.</li>
+  inside of the loop.  It is enabled by the <code>-fsplit-loops</code>
+  option and at the <code>-O3</code> optimization level or higher.</li>
 
-  <li>Shrink-wrapping optimization can now separate portions of
+  <li>The shrink-wrapping optimization can now separate portions of
   prologues and epilogues to improve performance if some of the
   work done traditionally by prologues and epilogues is not needed
   on certain paths.  This is controlled by the
@@ -138,7 +137,7 @@ 
   </li>
 
   <li>The <code>-fsanitize=signed-integer-overflow</code> suboption of the
-  UndefinedBehavior Sanitizer now diagnose arithmetic overflows even on
+  UndefinedBehavior Sanitizer now diagnoses arithmetic overflows even on
   arithmetic operations with generic vectors.</li>
 
   <li>Version 5 of the <a
@@ -525,8 +524,8 @@ 
 <li>New <code>__builtin_add_overflow_p</code>,
   <code>__builtin_sub_overflow_p</code>,
   <code>__builtin_mul_overflow_p</code> built-in functions have been added.
-  These work similarly to earlier added built-in functions without the
-  <code>_p</code> suffix, but don't actually store the result of the
+  These work similarly to their siblings without the
+  <code>_p</code> suffix, but do not actually store the result of the
   arithmetics anywhere, just return whether the operation would overflow.
   These builtins allow easy checking for overflows e.g. in C++
   <code>constexpr</code> contexts.</li>
@@ -566,7 +565,7 @@ 
   (suffixed <code>f<i>N</i></code> or <code>f<i>N</i>x</code>) for the
   new
   types: <code>__builtin_copysign</code>, <code>__builtin_fabs</code>, <code>__builtin_huge_val</code>, <code>__builtin_inf</code>, <code>__builtin_nan</code>, <code>__builtin_nans</code>.</p></li>
-  <li>Compilation with <code>-fopenmp</code> is now compatible with
+  <li>Compilation with <code>-fopenmp</code> is now compatible with the
   C11 <code>_Atomic</code> keyword.</li>
 </ul>
 
@@ -730,8 +729,8 @@ 
   </li>
   <li>Version 4.5 of the <a href="http://www.openmp.org/specifications/"
       >OpenMP specification</a> is now partially supported also in the
-      Fortran compilers, largest missing support in the Fortran frontend
-      is structure element mapping.</li>
+      Fortran compiler; the largest missing item is structure element
+      mapping.</li>
       
   <li>User-defined derived-type input/output (UDTIO) is added.</li>
   
@@ -765,11 +764,13 @@ 
 </ul>
 
 <h3 id="java">Java (GCJ)</h3>
+
 <p>The GCC Java frontend and associated libjava runtime library have been
 removed from GCC.</p>
 
 <!-- .................................................................. -->
 <h2 id="jit">libgccjit</h2>
+
 <p>The libgccjit API gained support for marking calls as requiring
 tail-call optimization via a new entrypoint:
 <a href="https://gcc.gnu.org/onlinedocs/jit/topics/expressions.html#gcc_jit_rvalue_set_bool_require_tail_call">gcc_jit_rvalue_set_bool_require_tail_call</a>.</p>
@@ -946,7 +947,8 @@ 
 <h3 id="nvptx">NVPTX</h3>
 <ul>
   <li>OpenMP target regions can now be offloaded to NVidia PTX GPGPUs.
-      See https://gcc.gnu.org/wiki/Offloading on how to configure it.</li>
+  See the <a href="https://gcc.gnu.org/wiki/Offloading">Offloading Wiki</a>
+  on how to configure it.</li>
 </ul>
 
 <h3 id="powerpc">PowerPC / PowerPC64 / RS6000</h3>