diff gcc/doc/match-and-simplify.texi @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
line wrap: on
line diff
--- a/gcc/doc/match-and-simplify.texi	Fri Oct 27 22:46:09 2017 +0900
+++ b/gcc/doc/match-and-simplify.texi	Thu Oct 25 07:37:49 2018 +0900
@@ -1,4 +1,4 @@
-@c Copyright (C) 2014-2017 Free Software Foundation, Inc.
+@c Copyright (C) 2014-2018 Free Software Foundation, Inc.
 @c Free Software Foundation, Inc.
 @c This is part of the GCC manual.
 @c For copying conditions, see the file gcc.texi.
@@ -205,7 +205,7 @@
   (pointer_plus (addr@@2 @@0) INTEGER_CST_P@@1)
   (if (is_gimple_min_invariant (@@2)))
   @{
-    HOST_WIDE_INT off;
+    poly_int64 off;
     tree base = get_addr_base_and_unit_offset (@@0, &off);
     off += tree_to_uhwi (@@1);
     /* Now with that we should be able to simply write
@@ -250,7 +250,9 @@
 
 The second supported flag is @code{s} which tells the code
 generator to fail the pattern if the expression marked with
-@code{s} does have more than one use.  For example in
+@code{s} does have more than one use and the simplification
+results in an expression with more than one operator.
+For example in
 
 @smallexample
 (simplify
@@ -261,6 +263,14 @@
 this avoids the association if @code{(pointer_plus @@0 @@1)} is
 used outside of the matched expression and thus it would stay
 live and not trivially removed by dead code elimination.
+Now consider @code{((x + 3) + -3)} with the temporary
+holding @code{(x + 3)} used elsewhere.  This simplifies down
+to @code{x} which is desirable and thus flagging with @code{s}
+does not prevent the transform.  Now consider @code{((x + 3) + 1)}
+which simplifies to @code{(x + 4)}.  Despite being flagged with
+@code{s} the simplification will be performed.  The
+simplification of @code{((x + a) + 1)} to @code{(x + (a + 1))} will
+not performed in this case though.
 
 More features exist to avoid too much repetition.